Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
fix: ran generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 28, 2018
1 parent c1e27b7 commit 21a2334
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 359 deletions.
37 changes: 22 additions & 15 deletions package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,35 @@ const linters = {
tslint: script('tslint -p test', 'lint ts files'),
}

const scripts = {
...linters,
lint: concurrent(linters),
test: script(concurrent.nps(...Object.keys(linters), 'mocha'), 'lint and run all tests'),
mocha: script('mocha --forbid-only "test/**/*.test.ts"', 'run all mocha tests'),
}

let test = 'mocha --forbid-only "test/**/*.test.ts"'
if (process.env.CI) {
if (process.env.CIRCLECI) {
scripts.test.script = series(mkdirp('reports'), scripts.test.script)
// add mocha junit reporter
scripts.mocha.script = crossEnv(`MOCHA_FILE=reports/mocha.xml ${scripts.mocha.script} --reporter mocha-junit-reporter`)
test = crossEnv(`MOCHA_FILE=reports/mocha.xml ${test} --reporter mocha-junit-reporter`)
// add eslint reporter
scripts.eslint.script = `${scripts.eslint.script} --format junit --output-file reports/eslint.xml`
linters.eslint.script = `${linters.eslint.script} --format junit --output-file reports/eslint.xml`
// add tslint reporter
scripts.tslint.script = `${scripts.tslint.script} --format junit > reports/tslint.xml`
scripts.release = 'semantic-release -e @dxcli/dev-semantic-release'
linters.tslint.script = `${linters.tslint.script} --format junit > reports/tslint.xml`
}
// add code coverage reporting with nyc
const nyc = 'nyc --nycrc-path node_modules/@dxcli/dev-nyc-config/.nycrc'
const nyc = 'nyc --nycrc-path node_modules/@dxcli/nyc-config/.nycrc'
const nycReport = `${nyc} report --reporter text-lcov > coverage.lcov`
scripts.mocha.script = series(`${nyc} ${scripts.mocha.script}`, nycReport)
test = series(`${nyc} ${test}`, nycReport)
}

module.exports = {scripts}
test = concurrent({
...linters,
test: series('nps build', test),
})

if (process.env.CI) test = series(mkdirp('reports'), test)

module.exports = {
scripts: {
...linters,
build: series('rm -rf lib', 'tsc'),
lint: concurrent(linters),
test,
release: 'semantic-release -e @dxcli/semantic-release',
},
}
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@
"stdout-stderr": "^0.1.4"
},
"devDependencies": {
"@dxcli/dev": "^2.0.4",
"@dxcli/dev": "^2.0.12",
"@dxcli/semantic-release": "^0.2.4",
"@dxcli/tslint": "^0.0.23",
"@types/sinon": "^4.1.3",
"chai": "^4.1.2",
"chalk": "^2.3.0",
"eslint": "^4.16.0",
"http-call": "^5.0.2",
"husky": "^0.14.3",
"mocha": "^5.0.0",
"mocha-junit-reporter": "^1.17.0",
"nock": "^9.1.6",
"nps": "^5.7.1",
"nps-utils": "^1.5.0",
"sinon": "^4.2.2"
"sinon": "^4.2.2",
"ts-node": "^4.1.0",
"typescript": "^2.6.2"
},
"engines": {
"node": ">=8.0.0"
Expand All @@ -36,9 +41,9 @@
"main": "lib/index.js",
"repository": "jdxcode/fancy-test",
"scripts": {
"commitmsg": "dxcli-dev-commitmsg",
"commitmsg": "dxcli-commitlint",
"precommit": "nps lint -l warn",
"prepare": "rm -rf lib && tsc",
"prepublishOnly": "rm -rf lib && nps build",
"test": "nps test -l warn"
},
"types": "lib/index.d.ts"
Expand Down
3 changes: 3 additions & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "../tsconfig",
"compilerOptions": {
"sourceMap": true
},
"include": [
"./**/*",
"../src/**/*"
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
"rootDirs": [
"./src"
],
"sourceMap": true,
"strict": true,
"strictFunctionTypes": false,
"target": "esnext"
"target": "es2017"
},
"include": [
"./src/**/*"
Expand Down
Loading

0 comments on commit 21a2334

Please sign in to comment.