我用Jest编写了一个集成测试:
import 'jest-styled-components';
import React from 'react';
import { remAuto } from 'tidee-life-theme';
test('blah', () => {});
Cannot find module 'react-hot-loader' from 'core.js'
7 | const core = {
8 | 'background-color': '#fff',
> 9 | 'color': fontColor,
| ^
10 | 'font-family': fontFamily,
11 | 'font-family-bold': fontFamilyBold,
12 | 'font-size': fontSize,
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:221:17)
at ../tidee-life-theme/src/core.js:9:91
at Object.<anonymous> (../tidee-life-theme/src/core.js:11:3)
当我看着
core.js
,没有参考
react-hot-loader
export const fontColor = "#666";
export const fontFamily = `'open_sansregular', helvetica, arial`;
export const fontFamilyBold = `'open_sansbold', helvetica, arial`;
export const fontSize = 13;
export const fontLineHeight = 17 /13;
const core = {
'background-color': '#fff',
'color': fontColor,
'font-family': fontFamily,
'font-family-bold': fontFamilyBold,
'font-size': fontSize,
'line-height': fontLineHeight,
};
export default core;
我用的是lerna和
tidee-life-theme
那么,这到底是怎么回事?