From 48e6a09a0299dfe4103076c17849b53fa34bf07a Mon Sep 17 00:00:00 2001
From: Neil Kalman
Date: Sun, 19 May 2019 17:40:49 +0300
Subject: [PATCH] fix: integrate coveralls
---
.gitignore | 3 +++
.travis.yml | 12 ++++++------
README.md | 14 +++++++-------
jest.config.js | 16 ++++++++++++++++
package.json | 12 ++++++++----
src/alfred.test.ts | 3 +++
6 files changed, 43 insertions(+), 17 deletions(-)
create mode 100644 jest.config.js
create mode 100644 src/alfred.test.ts
diff --git a/.gitignore b/.gitignore
index ff1a182..5bed253 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,9 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage
+# test reports
+test-results/**
+
# nyc test coverage
.nyc_output
diff --git a/.travis.yml b/.travis.yml
index 980db61..18f77c1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,12 +15,12 @@ stages:
- deploy
jobs:
include:
- # - stage: test
- # node_js: lts/*
- # script:
- # - npm run build
- # - npm run test
- # - npm run coveralls
+ - stage: test
+ node_js: lts/*
+ script:
+ - npm run build
+ - npm run test
+ - npm run coveralls
- stage: release
node_js: lts/*
script:
diff --git a/README.md b/README.md
index dc41594..2137b09 100644
--- a/README.md
+++ b/README.md
@@ -1,20 +1,20 @@
-
alfred
+ @kibibit/alfred
-
+
-
-
-
+
+
+
-
-->
+
Monitor Jenkins jobs to completion from node or cli
diff --git a/jest.config.js b/jest.config.js
new file mode 100644
index 0000000..b3503ff
--- /dev/null
+++ b/jest.config.js
@@ -0,0 +1,16 @@
+module.exports = {
+ preset: 'ts-jest',
+ testEnvironment: 'node',
+ coverageReporters: ["json", "lcov", "text", "clover", "html"],
+ modulePathIgnorePatterns: ["/lib/"],
+ collectCoverageFrom: [
+ "src/**/*.ts",
+ "!src/**/index.ts",
+ // "!src/announce-it-cli.ts"
+ ],
+ watchPathIgnorePatterns: [
+ ".*test-results.*\\.js"
+ ],
+ reporters: ["default", "jest-stare"],
+ testResultsProcessor: "./node_modules/jest-stare"
+};
diff --git a/package.json b/package.json
index 629f2b1..cf5be4b 100644
--- a/package.json
+++ b/package.json
@@ -20,8 +20,7 @@
"semantic-release": "semantic-release",
"start": "node ./lib/alfred-cli",
"test:watch": "jest --watchAll --coverage",
- "test": "jest --coverage",
- "tests": "tsc"
+ "test": "jest --coverage"
},
"repository": {
"type": "git",
@@ -76,17 +75,22 @@
"@types/command-line-usage": "^5.0.1",
"@types/fs-extra": "^7.0.0",
"@types/jenkins": "^0.23.1",
+ "@types/jest": "^24.0.13",
"@types/lodash": "^4.14.129",
"all-contributors-cli": "^6.4.0",
"coveralls": "^3.0.3",
"jest": "^24.8.0",
"jest-stare": "^1.13.2",
"npm-check": "^5.9.0",
+ "semantic-release": "^16.0.0-beta.18",
"semantic-release-cli": "^5.1.0",
"ts-jest": "^24.0.2",
"ts-node": "^8.1.0",
"tslint": "^5.16.0",
- "typescript": "^3.4.5",
- "semantic-release": "^16.0.0-beta.18"
+ "typescript": "^3.4.5"
+ },
+ "jest-stare": {
+ "resultDir": "test-results/",
+ "coverageLink": "../coverage/index.html"
}
}
diff --git a/src/alfred.test.ts b/src/alfred.test.ts
new file mode 100644
index 0000000..461ab27
--- /dev/null
+++ b/src/alfred.test.ts
@@ -0,0 +1,3 @@
+describe('alfred', () => {
+ it.todo('should throw error when missing options');
+});