Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate to nuxt/test-utils #2376

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions server/e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { root } from '~/test/api-e2e/supertest'
import { fetch, setup } from '@nuxt/test-utils/e2e'

describe('index page', () => {
setup({ endpoint: process.env.TEST_URL })

Check failure on line 4 in server/e2e.test.ts

View workflow job for this annotation

GitHub Actions / Lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
it('is accessible', async () => {
const response = await root().get('/')
expect(response.statusCode).toBe(200)
const response = await fetch('/')
expect(response.status).toBe(200)
})
})

describe('download', () => {
setup({ endpoint: process.env.TEST_URL })

Check failure on line 12 in server/e2e.test.ts

View workflow job for this annotation

GitHub Actions / Lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
it('redirects to fosshub', async () => {
const response = (await root().get('/download')) as unknown as {
statusCode: number
headers: { location: string }
}
expect(response.statusCode).toBe(302)
expect(response.headers.location).toBe(
const response = await fetch('/download')
expect(response.status).toBe(302)
expect(response.headers.get('location')).toBe(
'https://www.fosshub.com/JabRef.html',
)
})
Expand Down
Loading