test
This commit is contained in:
@@ -6,4 +6,4 @@ export default defineNuxtConfig({
|
|||||||
pinia: {
|
pinia: {
|
||||||
storesDirs: ['./stores/**'],
|
storesDirs: ['./stores/**'],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -23,11 +23,5 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"pnpm": ">=10 <11"
|
"pnpm": ">=10 <11"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748",
|
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
|
||||||
"devDependencies": {
|
|
||||||
"@pinia/testing": "^1.0.2",
|
|
||||||
"@vue/test-utils": "^2.4.6",
|
|
||||||
"jsdom": "^27.0.0",
|
|
||||||
"vitest": "^3.2.4"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
671
pnpm-lock.yaml
generated
671
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,16 +0,0 @@
|
|||||||
import fs from 'fs'
|
|
||||||
import path from 'path'
|
|
||||||
import { mount } from '@vue/test-utils'
|
|
||||||
import { describe, it, expect } from 'vitest'
|
|
||||||
|
|
||||||
const pagesDir = path.resolve(__dirname, '../pages')
|
|
||||||
const pages = fs.readdirSync(pagesDir).filter(f => f.endsWith('.vue'))
|
|
||||||
|
|
||||||
describe('Sanity check: pages mount correctly', () => {
|
|
||||||
for (const page of pages) {
|
|
||||||
it(`should mount ${page} without unresolved components`, async () => {
|
|
||||||
const Page = (await import(path.join(pagesDir, page))).default
|
|
||||||
expect(() => mount(Page)).not.toThrow()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { setActivePinia, createPinia } from 'pinia'
|
|
||||||
import { describe, it, expect, beforeEach } from 'vitest'
|
|
||||||
import { useTestStore } from '~/stores/testStore'
|
|
||||||
|
|
||||||
describe('TestStore sanity', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
setActivePinia(createPinia())
|
|
||||||
})
|
|
||||||
|
|
||||||
it('adds data correctly', async () => {
|
|
||||||
const store = useTestStore()
|
|
||||||
await store.addData()
|
|
||||||
expect(store.getDatas).toContain('fdgfg')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
Reference in New Issue
Block a user