Selaa lähdekoodia

use node:latest-browsers images (#2966)

* use node:latest-browsers images

* fix no-extraneous-dependencies error
陈帅 7 vuotta sitten
vanhempi
commit
0745731b63
7 muutettua tiedostoa jossa 9 lisäystä ja 25 poistoa
  1. 1 2
      .circleci/config.yml
  2. 1 3
      .eslintignore
  3. 4 1
      .eslintrc.js
  4. 1 8
      Dockerfile
  5. 1 1
      package.json
  6. 0 8
      tests/fix_puppeteer.sh
  7. 1 2
      tests/run-tests.js

+ 1 - 2
.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

+ 1 - 3
.eslintignore

@@ -1,3 +1 @@
-/functions/mock
-/tests/*
-./*
+/functions/mock/**

+ 4 - 1
.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,

+ 1 - 8
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"]

+ 1 - 1
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",

+ 0 - 8
tests/fix_puppeteer.sh

@@ -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

+ 1 - 2
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