2019-01-12 11:33:27 +08:00
|
|
|
import pkg from '../package.json';
|
2018-05-13 23:11:51 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
const testDist = process.env.LIB_DIR === 'dist';
|
2018-05-13 23:11:51 +08:00
|
|
|
|
|
|
|
describe('antd dist files', () => {
|
|
|
|
// https://github.com/ant-design/ant-design/issues/1638
|
|
|
|
// https://github.com/ant-design/ant-design/issues/1968
|
|
|
|
it('exports modules correctly', () => {
|
2019-01-12 11:33:27 +08:00
|
|
|
const antd = testDist ? require('../dist/antd') : require('../components'); // eslint-disable-line global-require
|
|
|
|
expect(Object.keys(antd)).toMatchSnapshot();
|
|
|
|
});
|
2018-05-13 23:11:51 +08:00
|
|
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/1970
|
|
|
|
// https://github.com/ant-design/ant-design/issues/1804
|
|
|
|
if (testDist) {
|
|
|
|
it('should have antd.version', () => {
|
2019-01-12 11:33:27 +08:00
|
|
|
const antd = require('../dist/antd'); // eslint-disable-line global-require
|
|
|
|
expect(antd.version).toBe(pkg.version);
|
|
|
|
});
|
2018-05-13 23:11:51 +08:00
|
|
|
}
|
2019-01-12 11:33:27 +08:00
|
|
|
});
|