Skip to content

Commit

Permalink
fix: unit test (#170)
Browse files Browse the repository at this point in the history
* refactor: rewrite to pure function

* build(deps-dev): bump jest & ts-jest deps

* chore: add coverage reports
  • Loading branch information
pure-js authored May 10, 2023
1 parent d3d05c0 commit 21635c8
Show file tree
Hide file tree
Showing 7 changed files with 768 additions and 734 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
*.png binary
*.gif binary
*.ico binary

package-lock.json merge=theirs
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ dist/
# Local files
*.local

# Test Coverage
coverage/

# Playwright
/test-results/
/playwright-report/
Expand Down
15 changes: 4 additions & 11 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
/*
* For a detailed explanation regarding each configuration property, visit:
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
export default {
// All imported modules in your tests should be mocked automatically
// automock: false,

"extensionsToTreatAsEsm": [".ts"],

// Stop running tests after `n` failures
// bail: 0,

Expand All @@ -20,13 +17,13 @@ export default {
// clearMocks: false,

// Indicates whether the coverage information should be collected while executing the test
// collectCoverage: false,
collectCoverage: true,

// An array of glob patterns indicating a set of files for which coverage information should be collected
// collectCoverageFrom: undefined,

// The directory where Jest should output its coverage files
// coverageDirectory: undefined,
coverageDirectory: "coverage",

// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
Expand Down Expand Up @@ -68,11 +65,7 @@ export default {
// globalTeardown: undefined,

// A set of global variables that need to be available in all test environments
globals: {
'ts-jest': {
useESM: true,
},
},
// globals: {},

// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
// maxWorkers: "50%",
Expand Down
Loading

0 comments on commit 21635c8

Please sign in to comment.