0.1.3 • Published 6 years ago

@namics/test-suite v0.1.3

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

Test suite npm

reusable and easy to use jest test suite

Usage

npm i -D @namics/test-suite

This packages uses jest and enzyme please read their documentations for details. Most parts are copied from the Create React App unit test solution.

package.json

  ...
  "scripts": {
    "test": "test-suite --coverage",
    "test:dev": "test-suite",
    ...
  },
  ...

Collect Coverage

package.json

"jest": {
  "collectCoverageFrom": [
	"src/**/*.{js|jsx|ts|tsx}",
	"!src/**/*.stories.{js|jsx|ts|tsx}",
	"!src/dev.ts",
	"!src/index.tsx"
  ]
},

allowed configurations:

keydocumentation
collectCoverageFromhttps://jestjs.io/docs/en/configuration#collectcoveragefrom-array
coverageReportershttps://jestjs.io/docs/en/configuration#coveragereporters-array-string
coverageThresholdhttps://jestjs.io/docs/en/configuration#coveragethreshold-object
resetMockshttps://jestjs.io/docs/en/configuration#resetmocks-boolean
resetModuleshttps://jestjs.io/docs/en/configuration#resetmodules-boolean
snapshotSerializershttps://jestjs.io/docs/en/configuration#snapshotserializers-array-string
watchPathIgnorePatternshttps://jestjs.io/docs/en/configuration#watchpathignorepatterns-array-string

License

MIT License