-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test for appendParams and create http error
- Loading branch information
Showing
6 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { appendParams } from './append-params.js' | ||
|
||
describe('appendParams', () => { | ||
it('working', async () => { | ||
const params = appendParams('http://localhost', { | ||
hello: 'world', | ||
}) | ||
expect(params).equals('http://localhost/?hello=world') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { createHTTPError } from './create-http-error.js' | ||
|
||
describe('createHTTPError', () => { | ||
it('working', async () => { | ||
const params = createHTTPError(new Response(), new Response()) | ||
expect(params.message).equals('status code 200') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// vitest.config.ts | ||
import { defineConfig } from "vitest/config"; | ||
import { defineConfig } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
test: { | ||
include: ["**/src/*.test.ts"], | ||
include: ['**/src/**/*.test.ts'], | ||
globals: true, | ||
}, | ||
}); | ||
}) |