Skip to content

Commit

Permalink
test: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
climba03003 committed Oct 29, 2021
1 parent 44007aa commit a31f3dc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .taprc
@@ -0,0 +1,5 @@
ts: false
jsx: false
flow: false
check-coverage: true
coverage: true
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"lint": "standard",
"lint:fix": "npm run lint -- --fix",
"unit": "tap",
"unit": "tap test/*.test.js",
"unit:typescript": "tsd",
"test": "npm run lint && npm run unit && npm run unit:typescript",
"coverage": "tap --coverage --coverage-report=lcovonly"
Expand Down
16 changes: 15 additions & 1 deletion test/index.test-d.ts
Expand Up @@ -27,4 +27,18 @@ expectType<SecureURL>(new SecureURL('', '', { mode: 'path', keepPort: true }))
expectError(new SecureURL())
expectError(new SecureURL(true))
expectError(new SecureURL({}))
expectError(new SecureURL('', { mode: 'invalid' }))
expectError(new SecureURL('', { mode: 'invalid' }))

const url = new SecureURL('https://localhost.local/')
expectType<string>(url.href)
expectType<string>(url.origin)
expectType<string>(url.host)
expectType<string>(url.protocol)
expectType<string>(url.username)
expectType<string>(url.password)
expectType<string>(url.hostname)
expectType<number | undefined>(url.port)
expectType<string>(url.pathname)
expectType<string>(url.hash)
expectType<string>(url.search)
expectType<URLSearchParams>(url.searchParams)

0 comments on commit a31f3dc

Please sign in to comment.