test
All checks were successful
Deploy App / test (push) Successful in 9s
Deploy App / deploy (push) Successful in 51s

This commit is contained in:
valere
2025-09-20 00:48:03 +02:00
parent f919438ca9
commit c5da118661
5 changed files with 712 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml* ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm test
RUN pnpm build
# Stage production

View File

@@ -7,7 +7,8 @@
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
"postinstall": "nuxt prepare",
"test": "vitest run"
},
"dependencies": {
"@nuxt/eslint": "1.9.0",
@@ -22,5 +23,11 @@
"engines": {
"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

File diff suppressed because it is too large Load Diff

16
tests/page.spec.ts Normal file
View File

@@ -0,0 +1,16 @@
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()
})
}
})

15
tests/stores.spec.ts Normal file
View File

@@ -0,0 +1,15 @@
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')
})
})