Skip to content

Commit

Permalink
refactor(test): avoid async if no needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jun 15, 2023
1 parent 6665cd9 commit 3f56d78
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/vm/tests/integration/request.test.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
/**
* @jest-environment ../jest-environment/dist
*/
test('evaluate promise', async () => {
test('evaluate promise', () => {
const url = 'https://vercel.com/foo/bar?one=value'
const req = new Request(url)
expect(req.url).toEqual(url)
})

test('parses and reconstructs the URL alone', async () => {
test('parses and reconstructs the URL alone', () => {
const url = 'https://vercel.com/foo/bar?one=value'
const req = new Request(url)
expect(req.url).toEqual(url)
})

test('throws when the URL is malformed', async () => {
test('throws when the URL is malformed', () => {
try {
void new Request('meeeh')
} catch (error: any) {
expect(error.message).toEqual('Failed to parse URL from meeeh')
}
})

test('Request.referrer is `about:client` by default', async () => {
test('Request.referrer is `about:client` by default', () => {
const request = new Request('https://example.vercel.sh')
expect(request.referrer).toEqual('about:client')
})

test('Request.referrer can be customized', async () => {
test('Request.referrer can be customized', () => {
const request = new Request('https://example.vercel.sh', {
referrer: 'https://vercel.com/home',
})
Expand Down

0 comments on commit 3f56d78

Please sign in to comment.