-
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.
#2 Adding remaining tests to achieve full code co…
…verage, also fixed one bug exposed by that.
- Loading branch information
Showing
5 changed files
with
110 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* @file This file contains tests for file `../errors.ts`. | ||
*/ | ||
|
||
import test from "ava"; | ||
import * as spec from "../errors"; | ||
|
||
test("Validate that isNon2xxStatusCodeError method works", (c) => { | ||
c.plan(2); | ||
c.true(spec.isNon2xxStatusCodeError(new spec.Non2xxStatusCodeError(999))); | ||
c.false(spec.isNon2xxStatusCodeError(new Error())); | ||
}); |
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,9 @@ | ||
/** | ||
* @file This is entrypoint file for this package, exporting all non-internal files. | ||
*/ | ||
|
||
export * from "./client"; | ||
export type { Non2xxStatusCodeError } from "./errors"; | ||
export { isNon2xxStatusCodeError } from "./errors"; | ||
|
||
// Don't export anything from internal.ts |
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 @@ | ||
/** | ||
* @file This file contains internally constants, so that they can be used in tests as well. | ||
*/ | ||
|
||
export const DUMMY_ORIGIN = "ftp://__dummy__"; |