test: fix test

This commit is contained in:
fushen 2019-12-24 00:43:51 +08:00
parent 45ce217c9e
commit 953ac257d4
3 changed files with 7 additions and 9 deletions

View File

@ -6,5 +6,6 @@
"targets": ["web"]
}
]
]
],
"inlineStyle": true
}

View File

@ -1,13 +1,10 @@
const config = require('../../jest.config');
module.exports = {
...config,
roots: [__dirname],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|scss|stylesheet)$': '<rootDir>/__mocks__/styleMock.js',
'\\.(md)$': '<rootDir>/__mocks__/htmlMock.js',
'<rootDir>/../../__mocks__/fileMock.js',
'\\.(css|scss|stylesheet)$': '<rootDir>/../../__mocks__/styleMock.js',
'\\.(md)$': '<rootDir>/../../__mocks__/htmlMock.js',
},
moduleDirectories: ['<rootDir>/node_modules', 'src'],
};

View File

@ -9,8 +9,7 @@
"start": "build-scripts start",
"prestorybook": "yarn test:generate-output",
"storybook": "start-storybook -p 9009 -s public",
"test": "jest",
"test:generate-output": "jest --json --outputFile=jest-test-results.json --config=./jest-addon.config.js -u"
"test": "jest --logHeapUsage --detectOpenHandles"
},
"dependencies": {
"driver-universal": "^3.0.0",
@ -44,6 +43,7 @@
"babel-eslint": "^10.0.3",
"babel-preset-rax": "^1.0.0-beta.0",
"build-plugin-rax-app": "^0.2.0",
"jest": "^24.9.0",
"rax-test-renderer": "^1.0.0",
"stylesheet-loader": "^0.6.5"
}