ant-design-vue/tests/index.test.js

22 lines
775 B
JavaScript
Raw Normal View History

2019-01-12 03:33:27 +00:00
import pkg from '../package.json';
2018-05-13 15:11:51 +00:00
2019-01-12 03:33:27 +00:00
const testDist = process.env.LIB_DIR === 'dist';
2018-05-13 15:11:51 +00: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 03:33:27 +00:00
const antd = testDist ? require('../dist/antd') : require('../components'); // eslint-disable-line global-require
expect(Object.keys(antd)).toMatchSnapshot();
});
2018-05-13 15:11:51 +00: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 03:33:27 +00:00
const antd = require('../dist/antd'); // eslint-disable-line global-require
expect(antd.version).toBe(pkg.version);
});
2018-05-13 15:11:51 +00:00
}
2019-01-12 03:33:27 +00:00
});