i am using react-mobx store in my react project while running test-case jest is not able to find helper functions that is in my component,
getting error:
tests/components/common/Sidebar/Sidebar.test.js
● Test suite failed to run
ReferenceError: regeneratorRuntime is not defined
**test.js**
const stores = {
applicationModel: {},
}
describe('Breadcrumb', () => {
it('should not render the breadcrumb with no items', () => {
const properties = {
breadcrumb: [
{
name: '',
path: '',
params: {}
},
],
separator: '',
applicationModel: {}
}
const renderedComponent = shallow(<Breadcrumb.wrappedComponent {...properties}/>)
const expectedRenderedHTML = <div className='test' />
expect(renderedComponent).toContainReact(expectedRenderedHTML)
})
**jest.config.js**
module.exports = {
verbose: true,
setupFiles: [
'<rootDir>/setupTests.js',
'<rootDir>/src/utils/helpers.js',
'<rootDir>/src/utils/api.js',
'<rootDir>/src/utils/functions.js'
],
testRegex: '(/__tests__/.*|(\.|/)test)\.jsx?$',
moduleNameMapper: {
'\.(css|scss)$': '<rootDir>/__mocks__/styleMock.js',
},
setupTestFrameworkScriptFile: '<rootDir>/node_modules/jest-enzyme/lib/index.js',
transform: {
'.*': '<rootDir>/node_modules/babel-jest',
},
collectCoverage: true,
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…