Skip to content

Commit

Permalink
test: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Aug 1, 2022
1 parent f6b6771 commit 3e369a2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 85 deletions.
4 changes: 2 additions & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ done

if [[ $ARG1 ]]
then
echo "npx vitest run -t $ARG1"
(npx vitest run -t $ARG1.test)
echo "npx vitest run $ARG1"
(npx vitest run $ARG1.test)
else
echo "npx vitest run"
(npx vitest run)
Expand Down
11 changes: 10 additions & 1 deletion test/document-driven.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('fixtures:document-driven', async () => {
test('<title> from front-matter', async () => {
const html = await $fetch('/')

expect(html).contains('Home | Document Driven Fixture')
expect(html).contains('<title>Home</title>')
})

test('disabled document driven', async () => {
Expand Down Expand Up @@ -46,4 +46,13 @@ describe('fixtures:document-driven', async () => {
expect(html).contains('with previous link /layout')
expect(html).contains('with next link /no-surround')
})

test('404 page', async () => {
try {
await $fetch('/page-not-found')
} catch (e) {
expect(e.response.status).toBe(404)
expect(e.response.statusText).toBe('Page not found: /page-not-found')
}
})
})
82 changes: 0 additions & 82 deletions test/fixtures/document-driven/pages/[...slug].vue

This file was deleted.

0 comments on commit 3e369a2

Please sign in to comment.