Skip to content
This repository was archived by the owner on May 15, 2022. It is now read-only.

Commit a1cd6a5

Browse files
committed
Add moduleNameMapper to jest config
1 parent 862b90c commit a1cd6a5

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

jest.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ module.exports = {
1111
],
1212
collectCoverage: true,
1313
coveragePathIgnorePatterns: ['/node_modules/', '/__tests__/'],
14-
testMatch: ['**/__tests__/**/*.(spec|test).[jt]s?(x)']
14+
testMatch: ['**/__tests__/**/*.(spec|test).[jt]s?(x)'],
15+
// https://jestjs.io/docs/en/webpack.html#mocking-css-modules
16+
moduleNameMapper: {
17+
'\\.(scss)$': 'identity-obj-proxy'
18+
}
1519
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"eslint-plugin-react": "^7.14.2",
111111
"eslint-plugin-react-hooks": "^1.7.0",
112112
"husky": "^3.0.4",
113+
"identity-obj-proxy": "^3.0.0",
113114
"jest": "^24.9.0",
114115
"lint-staged": "^9.2.5",
115116
"prettier": "^1.18.2",

src/__tests__/DatGUI.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { render } from '@testing-library/react';
3-
import DatGUI from '../../dist/index.cjs';
3+
import DatGUI from '../index';
44

55
test('Renders without errors', () => {
66
render(<DatGUI data={{ data: {} }} onUpdate={() => null} />);

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3390,6 +3390,11 @@ har-validator@~5.1.0:
33903390
ajv "^6.5.5"
33913391
har-schema "^2.0.0"
33923392

3393+
harmony-reflect@^1.4.6:
3394+
version "1.6.1"
3395+
resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.6.1.tgz#c108d4f2bb451efef7a37861fdbdae72c9bdefa9"
3396+
integrity sha512-WJTeyp0JzGtHcuMsi7rw2VwtkvLa+JyfEKJCFyfcS0+CDkjQ5lHPu7zEhFZP+PDSRrEgXa5Ah0l1MbgbE41XjA==
3397+
33933398
has-ansi@^2.0.0:
33943399
version "2.0.0"
33953400
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
@@ -3542,6 +3547,13 @@ [email protected], icss-replace-symbols@^1.1.0:
35423547
resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded"
35433548
integrity sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=
35443549

3550+
identity-obj-proxy@^3.0.0:
3551+
version "3.0.0"
3552+
resolved "https://registry.yarnpkg.com/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz#94d2bda96084453ef36fbc5aaec37e0f79f1fc14"
3553+
integrity sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ=
3554+
dependencies:
3555+
harmony-reflect "^1.4.6"
3556+
35453557
ignore-walk@^3.0.1:
35463558
version "3.0.1"
35473559
resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8"

0 commit comments

Comments
 (0)