diff --git a/jest.config.js b/jest.config.js index 051bff869..741571854 100644 --- a/jest.config.js +++ b/jest.config.js @@ -8,6 +8,15 @@ module.exports = { 'node_modules', 'fixtures' ], - 'testRegex': '(/test/unit.*\\.spec|test/functional.*\\.func)\\.js' + 'testRegex': '(/test/unit.*\\.spec|test/functional.*\\.func|/test/webui/.*\\.spec)\\.js', // 'testRegex': '(test/functional.*\\.func)\\.js' + 'setupFiles': [ + './test/webui/global.js' + ], + 'modulePathIgnorePatterns': [ + 'global.js' + ], + 'moduleNameMapper': { + '\\.(scss)$': '/node_modules/jest-css-modules' + } }; diff --git a/package.json b/package.json index 2ff066401..117eecf86 100644 --- a/package.json +++ b/package.json @@ -97,6 +97,7 @@ "html-webpack-plugin": "2.30.1", "in-publish": "2.0.0", "jest": "^21.2.1", + "jest-css-modules": "^1.1.0", "jest-serializer-enzyme": "^1.0.0", "localstorage-memory": "1.0.2", "node-sass": "4.7.2", diff --git a/test/webui/components/test.spec.js b/test/webui/components/test.spec.js new file mode 100644 index 000000000..a3d83f82e --- /dev/null +++ b/test/webui/components/test.spec.js @@ -0,0 +1,5 @@ +describe('test', () => { + it('add', () => { + expect(2).toEqual(3); + }) +}) \ No newline at end of file diff --git a/test/webui/global.js b/test/webui/global.js new file mode 100644 index 000000000..d8c969448 --- /dev/null +++ b/test/webui/global.js @@ -0,0 +1,9 @@ +/** + * Setup configuration for Jest + * This file includes gloabl settings for the JEST environment. + */ +import 'raf/polyfill'; +import { configure } from 'enzyme'; +import Adapter from 'enzyme-adapter-react-16'; + +configure({ adapter: new Adapter() });