diff --git a/.circleci/config.yml b/.circleci/config.yml index 28ad7a2abf16c05bf6288223a682e30fe3eb703f..f889c7d7357ee8fb4abaeaab93dccd1f748aed25 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,10 +9,9 @@ jobs: - run: npm run build test: docker: - - image: circleci/node:latest + - image: circleci/node:latest-browsers steps: - checkout - - run: sh ./tests/fix_puppeteer.sh - run: npm install - run: command : npm run test:all diff --git a/.eslintignore b/.eslintignore index 516f165584801e4d712e646f5eb546ff40f1cd08..fa7856aeab5fd08d8d73b48a585bc3d4adb970bc 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1 @@ -/functions/mock -/tests/* -./* \ No newline at end of file +/functions/mock/** \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 56cd3d82a155627fd33b538e89906e2f7a4701b1..02f5cb1252fd2075644a8272aa21867ecf563ddd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,7 +22,10 @@ module.exports = { 'import/no-unresolved': [2, { ignore: ['^@/', '^umi/'] }], 'import/no-extraneous-dependencies': [ 2, - { optionalDependencies: true, devDependencies: false }, + { + optionalDependencies: true, + devDependencies: ['**/tests/**.js', '/mock/**.js', '**/**.test.js'], + }, ], 'jsx-a11y/no-noninteractive-element-interactions': 0, 'jsx-a11y/click-events-have-key-events': 0, diff --git a/Dockerfile b/Dockerfile index af06a83cec7cedbe3fbcfc24cf53414ee376afe5..7cbc5c31cd95e3cad949c50aa02103e126ae0c83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM circleci/node:latest +FROM circleci/node:latest-browsers WORKDIR /usr/src/app/ USER root @@ -7,13 +7,6 @@ RUN yarn COPY ./ ./ -RUN apt-get update -RUN apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \ - libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \ - libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \ - libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ - ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget - RUN npm run test:all CMD ["npm", "run", "build"] diff --git a/package.json b/package.json index f2a3f09453597d2c58e68aef02727f5e0ce82289..a7ef323c4e19916e3f693d162ba2354082a81596 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "antd": "^3.10.9", "bizcharts": "^3.4.0", "bizcharts-plugin-slider": "^2.1.1-beta.1", + "@antv/data-set": "^0.10.0", "classnames": "^2.2.6", "dva": "^2.4.0", "enquire-js": "^0.2.1", @@ -59,7 +60,6 @@ "react-router-dom": "^4.3.1" }, "devDependencies": { - "@antv/data-set": "^0.10.0", "@types/react": "^16.7.7", "@types/react-dom": "^16.0.10", "antd-pro-merge-less": "^0.2.0", diff --git a/tests/fix_puppeteer.sh b/tests/fix_puppeteer.sh deleted file mode 100644 index 99e78bd081a5281f054e8247b10d2ead9e509a5c..0000000000000000000000000000000000000000 --- a/tests/fix_puppeteer.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -sudo apt-get update -sudo apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \ - libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \ - libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \ - libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ - ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget diff --git a/tests/run-tests.js b/tests/run-tests.js index 2fc00c162b62ee0da98d2ba24826a960a756235f..02c42b08ad46779b636edb5ca985d0cd0161e683 100644 --- a/tests/run-tests.js +++ b/tests/run-tests.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ const { spawn } = require('child_process'); const { kill } = require('cross-port-killer'); @@ -20,10 +21,8 @@ startServer.on('exit', () => { kill(process.env.PORT || 8000); }); -// eslint-disable-next-line console.log('Starting development server for e2e tests...'); startServer.stdout.on('data', data => { - // eslint-disable-next-line console.log(data.toString()); if (!once && data.toString().indexOf('Compiled successfully') >= 0) { // eslint-disable-next-line