From 762b9239ef291192ee8920f12a44f7764726b145 Mon Sep 17 00:00:00 2001 From: louiswu Date: Tue, 30 Apr 2019 20:53:22 +0800 Subject: [PATCH] fix(ci): fix ci fix ci --- .circleci/config.yml | 2 +- .gitignore | 3 ++- .npmignore | 3 ++- jest.config.js | 13 +++++-------- package.json | 4 +++- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7da7f223..2dc480e6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,6 @@ version: 2 jobs: build: - context: global docker: # specify the version you desire here - image: circleci/node:10.14 @@ -36,3 +35,4 @@ jobs: # run tests! - run: yarn test + - run: yarn cov diff --git a/.gitignore b/.gitignore index 960be9a0..683cda1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules package-lock.json -yarn.lock \ No newline at end of file +yarn.lock +coverage \ No newline at end of file diff --git a/.npmignore b/.npmignore index 960be9a0..683cda1a 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,4 @@ node_modules package-lock.json -yarn.lock \ No newline at end of file +yarn.lock +coverage \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index a012ff28..264ac1b5 100644 --- a/jest.config.js +++ b/jest.config.js @@ -18,13 +18,13 @@ module.exports = { clearMocks: true, // Indicates whether the coverage information should be collected while executing the test - // collectCoverage: false, + collectCoverage: true, // An array of glob patterns indicating a set of files for which coverage information should be collected // collectCoverageFrom: null, // The directory where Jest should output its coverage files - coverageDirectory: "coverage", + coverageDirectory: 'coverage', // An array of regexp pattern strings used to skip coverage collection // coveragePathIgnorePatterns: [ @@ -124,7 +124,7 @@ module.exports = { // snapshotSerializers: [], // The test environment that will be used for testing - testEnvironment: "node", + testEnvironment: 'node', // Options that will be passed to the testEnvironment // testEnvironmentOptions: {}, @@ -133,10 +133,7 @@ module.exports = { // testLocationInResults: false, // The glob patterns Jest uses to detect test files - testMatch: [ - "**/__tests__/**/*.js?(x)", - "**/?(*.)+(spec|test).js?(x)" - ], + testMatch: ['**/__tests__/**/*.js?(x)', '**/?(*.)+(spec|test).js?(x)'] // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped // testPathIgnorePatterns: [ @@ -177,4 +174,4 @@ module.exports = { // Whether to use watchman for file crawling // watchman: true, -}; +} diff --git a/package.json b/package.json index 0a17732f..a3821ac9 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "tsn": "ts-node --no-cache", "release": "standard-version", "pub": "git push --follow-tags origin master && npm publish", - "test": "jest" + "test": "jest --config jest.config.js", + "cov": "codecov" }, "engines": { "node": ">= 7.6.0" @@ -23,6 +24,7 @@ "@types/node": "^11.13.8", "babel-core": "^6.26.3", "babel-loader": "^8.0.4", + "codecov": "^3.3.0", "commitizen": "^3.1.1", "cross-env": "^5.2.0", "cz-conventional-changelog": "^2.1.0",