From a31e0c62754c533a8c28b81b9741b81114d3f064 Mon Sep 17 00:00:00 2001 From: harttle Date: Mon, 28 Jan 2019 17:27:00 +0800 Subject: [PATCH] chore(CI): test use build matrix --- .travis.yml | 19 +++--------------- package.json | 55 ++++++++++++++++++++++++++-------------------------- 2 files changed, 30 insertions(+), 44 deletions(-) diff --git a/.travis.yml b/.travis.yml index 03e91feb9..38cac7d1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,27 +3,14 @@ node_js: - "8" - "6" - "4" +script: npm run lint && npm test jobs: include: - - stage: test - name: 'Linting' - node_js: "8" - script: npm run lint - - name: 'Unit Test' - node_js: "8" - script: npm run unit && npm run coveralls - - name: 'E2E Test' - script: npm run e2e - - - stage: build - node_js: "8" - script: npm run build - + - stage: coverage + script: npm run coverage && npm run coveralls - stage: release if: branch = master - node_js: "8" script: skip deploy: provider: script - skip_cleanup: true script: npx semantic-release diff --git a/package.json b/package.json index dc12fc31f..48add47fc 100644 --- a/package.json +++ b/package.json @@ -8,16 +8,15 @@ "types": "src/index.d.ts", "scripts": { "lint": "eslint src/ test/ *.js", - "dev": "mocha test/unit", - "unit": "cross-env NODE_ENV=test nyc --reporter=html mocha test/unit", + "test": "mocha test/unit", "e2e": "mocha test/e2e", - "test": "npm run lint && npm run unit && npm run e2e", + "coverage": "cross-env NODE_ENV=test nyc --reporter=html npm test", "coveralls": "nyc report --reporter=text-lcov | coveralls", "build": "rollup -c && ls -lh dist", + "version": "npm run build && git add -A dist", "demo:browser": "echo open http://localhost:8080/demo/browser && http-server -c-1", "demo:nodejs": "node ./demo/nodejs/index.js", - "demo:express": "cd ./demo/express/ && npm start", - "version": "npm run build && git add -A dist" + "demo:express": "cd ./demo/express/ && npm start" }, "repository": { "type": "git", @@ -42,38 +41,38 @@ "devDependencies": { "babel-core": "^6.26.3", "babel-plugin-external-helpers": "^6.22.0", - "babel-plugin-istanbul": "^4.1.6", + "babel-plugin-istanbul": "^5.1.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.7.0", "babel-runtime": "^6.26.0", - "chai": "^4.1.2", + "chai": "^4.2.0", "chai-as-promised": "^7.1.1", - "coveralls": "^3.0.0", + "coveralls": "^3.0.2", "cross-env": "^5.2.0", - "eslint": "^5.2.0", - "eslint-config-standard": "^11.0.0", - "eslint-plugin-import": "^2.7.0", - "eslint-plugin-mocha": "^5.1.0", - "eslint-plugin-node": "^7.0.1", - "eslint-plugin-promise": "^3.5.0", - "eslint-plugin-standard": "^3.0.1", - "express": "^4.16.1", + "eslint": "^5.12.1", + "eslint-config-standard": "^12.0.0", + "eslint-plugin-import": "^2.15.0", + "eslint-plugin-mocha": "^5.2.1", + "eslint-plugin-node": "^8.0.1", + "eslint-plugin-promise": "^4.0.1", + "eslint-plugin-standard": "^4.0.0", + "express": "^4.16.4", "http-server": "^0.11.1", - "jsdom": "^11.5.1", + "jsdom": "^13.2.0", "mocha": "^5.2.0", - "mock-fs": "^4.4.1", - "nyc": "^13.0.1", - "regenerator-runtime": "^0.12.1", - "rollup": "^0.64.1", - "rollup-plugin-alias": "^1.4.0", - "rollup-plugin-babel": "^3.0.7", - "rollup-plugin-node-resolve": "^3.3.0", + "mock-fs": "^4.7.0", + "nyc": "^13.1.0", + "regenerator-runtime": "^0.13.1", + "rollup": "^1.1.2", + "rollup-plugin-alias": "^1.5.1", + "rollup-plugin-babel": "^4.3.2", + "rollup-plugin-node-resolve": "^4.0.0", "rollup-plugin-shim": "^1.0.0", - "rollup-plugin-uglify": "^4.0.0", + "rollup-plugin-uglify": "^6.0.2", "semantic-release": "^15.13.3", - "sinon": "^6.1.4", - "sinon-chai": "^3.2.0", - "supertest": "^3.0.0" + "sinon": "^7.2.3", + "sinon-chai": "^3.3.0", + "supertest": "^3.4.2" }, "release": { "branch": "master"