From d829f6c0081e0b9b54c1316ab6785abcacd16bc4 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Mon, 23 Oct 2017 11:20:16 +0800 Subject: [PATCH 1/2] docs: expandedRowRender can not be boolean --- components/table/demo/dynamic-settings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/table/demo/dynamic-settings.md b/components/table/demo/dynamic-settings.md index 133d060473..87d3df982c 100644 --- a/components/table/demo/dynamic-settings.md +++ b/components/table/demo/dynamic-settings.md @@ -91,7 +91,7 @@ class Demo extends React.Component { } handleExpandChange = (enable) => { - this.setState({ expandedRowRender: enable ? expandedRowRender : false }); + this.setState({ expandedRowRender: enable ? expandedRowRender : undefined }); } handleTitleChange = (enable) => { From f03af93b860b41ea08aef2b5a67c96f0c5aebca4 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Mon, 23 Oct 2017 16:24:17 +0800 Subject: [PATCH 2/2] Optimize ci scripts --- .travis.yml | 19 ++++++++++--------- tests/index.test.js | 6 ++++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8cb212a380..33fd0b3353 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,9 @@ node_js: env: matrix: - TEST_TYPE=lint - - TEST_TYPE=dist - - TEST_TYPE=compile + - TEST_TYPE=test:dist + - TEST_TYPE=test:lib + - TEST_TYPE=test:es - TEST_TYPE=test:dom - TEST_TYPE=test:node @@ -17,18 +18,18 @@ script: - | if [ "$TEST_TYPE" = lint ]; then npm run lint - elif [ "$TEST_TYPE" = dist ]; then + elif [ "$TEST_TYPE" = test:dist ]; then npm run dist && \ node ./tests/dekko/dist.test.js && \ - LIB_DIR=dist npm test -- --coverage -w 2 - elif [ "$TEST_TYPE" = compile ]; then - npm run dist && \ + LIB_DIR=dist npm test -- -w 2 + elif [ "$TEST_TYPE" = test:lib ]; then npm run compile && \ node ./tests/dekko/lib.test.js && \ - LIB_DIR=es npm test -- --coverage -w 2 && \ - LIB_DIR=lib npm test -- --coverage -w 2 + LIB_DIR=lib npm test -- -w 2 + elif [ "$TEST_TYPE" = test:es ]; then + npm run compile && \ + LIB_DIR=es npm test -- -w 2 elif [ "$TEST_TYPE" = test:dom ]; then - npm run dist && \ npm test -- --coverage -w 2 && \ bash <(curl -s https://codecov.io/bash) elif [ "$TEST_TYPE" = test:node ]; then diff --git a/tests/index.test.js b/tests/index.test.js index e920ee205d..6faa5b07e8 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -1,16 +1,18 @@ import pkg from '../package.json'; +const testDist = process.env.LIB_DIR === 'dist'; + 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', () => { - const antd = process.env.CI ? require('../dist/antd') : require('../components'); // eslint-disable-line global-require + const antd = testDist ? require('../dist/antd') : require('../components'); // eslint-disable-line global-require expect(Object.keys(antd)).toMatchSnapshot(); }); // https://github.com/ant-design/ant-design/issues/1970 // https://github.com/ant-design/ant-design/issues/1804 - if (process.env.CI) { + if (testDist) { it('should have antd.version', () => { const antd = require('../dist/antd'); // eslint-disable-line global-require expect(antd.version).toBe(pkg.version);