-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(errors):
ERR_INVALID_URL_SCHEME
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
ee4609f
commit 4fff601
Showing
19 changed files
with
206 additions
and
236 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -296,6 +296,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
node-version: | ||
- 22 | ||
- 20 | ||
- 19 | ||
- 18 | ||
|
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
This file was deleted.
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
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
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,5 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`unit:errors/ERR_INVALID_URL_SCHEME > should build message from parameters (0) 1`] = `"The URL must be of scheme file"`; | ||
|
||
exports[`unit:errors/ERR_INVALID_URL_SCHEME > should build message from parameters (1) 1`] = `"The URL must be one of scheme file or node"`; |
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,36 @@ | ||
/** | ||
* @file Type Tests - ERR_INVALID_URL_SCHEME | ||
* @module errnode/errors/tests/unit-d/ERR_INVALID_URL_SCHEME | ||
*/ | ||
|
||
import { codes } from '#src/enums' | ||
import type { NodeError, NodeErrorConstructor } from '#src/interfaces' | ||
import type * as TestSubject from '../err-invalid-url-scheme' | ||
|
||
describe('unit-d:errors/ERR_INVALID_URL_SCHEME', () => { | ||
describe('ERR_INVALID_URL_SCHEME', () => { | ||
it('should be ErrInvalidUrlSchemeConstructor', () => { | ||
expectTypeOf<typeof TestSubject.default>() | ||
.toEqualTypeOf<TestSubject.ErrInvalidUrlSchemeConstructor>() | ||
}) | ||
}) | ||
|
||
describe('ErrInvalidUrlScheme', () => { | ||
it('should extend NodeError<codes.ERR_INVALID_URL_SCHEME>', () => { | ||
expectTypeOf<TestSubject.ErrInvalidUrlScheme>() | ||
.toMatchTypeOf<NodeError<codes.ERR_INVALID_URL_SCHEME>>() | ||
}) | ||
}) | ||
|
||
describe('ErrInvalidUrlSchemeConstructor', () => { | ||
it('should match NodeErrorConstructor', () => { | ||
// Arrange | ||
type T = TestSubject.ErrInvalidUrlScheme | ||
type Args = TestSubject.ErrInvalidUrlSchemeArgs | ||
|
||
// Expect | ||
expectTypeOf<TestSubject.ErrInvalidUrlSchemeConstructor>() | ||
.toMatchTypeOf<NodeErrorConstructor<T, Args>>() | ||
}) | ||
}) | ||
}) |
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,22 @@ | ||
/** | ||
* @file Unit Tests - ERR_INVALID_URL_SCHEME | ||
* @module errnode/errors/tests/unit/ERR_INVALID_URL_SCHEME | ||
*/ | ||
|
||
import TestSubject, { | ||
type ErrInvalidUrlScheme | ||
} from '../err-invalid-url-scheme' | ||
|
||
describe('unit:errors/ERR_INVALID_URL_SCHEME', () => { | ||
it.each<ConstructorParameters<typeof TestSubject>>([ | ||
['file'], | ||
[['file', 'node']] | ||
])('should build message from parameters (%#)', (...args) => { | ||
// Act | ||
const subject: ErrInvalidUrlScheme = new TestSubject(...args) | ||
|
||
// Expect | ||
expect(subject).to.have.property('message').be.a('string').that.is.not.empty | ||
expect(subject.message).toMatchSnapshot() | ||
}) | ||
}) |
Oops, something went wrong.