-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Jest setup and write a test * Code coverage? * Update calculateOverriddenConfig test * Throw if register gets bad input
- Loading branch information
1 parent
5a99369
commit 187885e
Showing
8 changed files
with
2,365 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ node_modules | |
/target | ||
/pkg | ||
/wasm-pack.log | ||
coverage | ||
|
||
scripts/*_exe.sh | ||
test/federalist/*.txt | ||
|
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,6 @@ | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
modulePathIgnorePatterns: ["<rootDir>/target/*", "<rootDir>/pkg/*"], | ||
collectCoverageFrom: ["js/**/*.{js,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,15 @@ | ||
import { defaultConfig, calculateOverriddenConfig } from "./config"; | ||
|
||
test("correctly overrides default config", () => { | ||
const expected = { | ||
showProgress: true, | ||
printIndexInfo: false, | ||
showScores: true | ||
}; | ||
|
||
const generated = calculateOverriddenConfig({ | ||
showScores: true | ||
}); | ||
|
||
expect(generated).toMatchObject(expected); | ||
}); |
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
Oops, something went wrong.