0.0.5 • Published 5 years ago

@putzisan/jest-test v0.0.5

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

Jest with enzyme

Jest is translated via babel-jest via babel to es5 and made usable, for special babel settings see babels test-specific options (NODE_ENV to test is set by jest).

ToDo

jest.config.js

configdescription
setupTestFrameworkScriptFiledev/setupTests.js configures jest-enzyme
testRegexall tests have to lay inside tests
moduleFileExtensionstest these extensions for import or require, corresponds to resolve.extensions in webpack.config.js
moduleNameMappermock static assets (img, CSS) see jest-doku - Handling Static Assets
transformpass every file through babel

jest-enzyme

jest-enzyme by AirBnB is integrated via dev/setupTests.js, which is linked to jest in setupTestFrameworkScriptFile (see jest.config.js).

jest-enzyme adds more matcher functions for jests expect. For an overview of these functions, see enzyme-docu for enzyme-matchers.

jest-dependencies

packagedescription
jesttest-module for js/react by facebook
jest-enzymeadds enzyme-matchers to jests expect
enzymeTest-utils for rendering and mounting React-Components
enzyme-adapter-react-16adapter for enzyme that it can mount and shallow-render React-16-Components