Compare commits

...

12 Commits

Author SHA1 Message Date
02dbe602b2 1.0.20 2019-04-08 17:52:41 +02:00
e17d7009d9 fix(core): update 2019-04-08 17:52:41 +02:00
d22534388d 1.0.19 2019-04-08 17:50:57 +02:00
e258b2d62e fix(core): update 2019-04-08 17:50:57 +02:00
5afe6e6981 1.0.18 2018-12-06 01:03:49 +01:00
5d071d0299 fix(core): update 2018-12-06 01:03:48 +01:00
180bfcb353 1.0.17 2018-12-06 00:56:36 +01:00
3161e6b4eb fix(core): update 2018-12-06 00:56:36 +01:00
6129388a20 1.0.16 2018-12-06 00:38:03 +01:00
8f0cfe1a06 fix(core): update 2018-12-06 00:38:03 +01:00
39926fb08b 1.0.15 2018-08-14 00:04:43 +02:00
36594b64f2 fix(dependencies): update 2018-08-14 00:04:42 +02:00
9 changed files with 858 additions and 334 deletions

View File

@ -26,6 +26,7 @@ mirror:
snyk: snyk:
stage: security stage: security
script: script:
- npmci npm prepare
- npmci command npm install -g snyk - npmci command npm install -g snyk
- npmci command npm install --ignore-scripts - npmci command npm install --ignore-scripts
- npmci command snyk test - npmci command snyk test
@ -36,21 +37,11 @@ snyk:
# ==================== # ====================
# test stage # test stage
# ==================== # ====================
testLEGACY:
stage: test
script:
- npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
allow_failure: true
testLTS: testLTS:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install lts - npmci node install lts
- npmci npm install - npmci npm install
- npmci npm test - npmci npm test
@ -62,6 +53,7 @@ testLTS:
testSTABLE: testSTABLE:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci npm test - npmci npm test
@ -118,6 +110,7 @@ pages:
stage: metadata stage: metadata
script: script:
- npmci command npm install -g typedoc typescript - npmci command npm install -g typedoc typescript
- npmci npm prepare
- npmci npm install - npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/ - npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
tags: tags:
@ -130,13 +123,3 @@ pages:
paths: paths:
- public - public
allow_failure: true allow_failure: true
windowsCompatibility:
image: stefanscherer/node-windows:10-build-tools
stage: metadata
script:
- npm install & npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- windows
allow_failure: true

View File

@ -2,5 +2,15 @@
"npmci": { "npmci": {
"npmGlobalTools": [], "npmGlobalTools": [],
"npmAccessLevel": "public" "npmAccessLevel": "public"
},
"gitzone": {
"module": {
"githost": "gitlab.com",
"gitscope": "gitzone",
"gitrepo": "tstest",
"shortDescription": "a test utility to run tests that match test/**/*.ts",
"npmPackagename": "@gitzone/tstest",
"license": "MIT"
}
} }
} }

1051
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@gitzone/tstest", "name": "@gitzone/tstest",
"version": "1.0.14", "version": "1.0.20",
"private": false, "private": false,
"description": "a test utility to run tests that match test/**/*.ts", "description": "a test utility to run tests that match test/**/*.ts",
"main": "dist/index.js", "main": "dist/index.js",
@ -19,16 +19,16 @@
"build": "(tsbuild)" "build": "(tsbuild)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.0.21", "@gitzone/tsbuild": "^2.1.8",
"@pushrocks/tapbundle": "^3.0.1" "@pushrocks/tapbundle": "^3.0.7"
}, },
"dependencies": { "dependencies": {
"@gitzone/tsrun": "^1.1.11", "@gitzone/tsrun": "^1.2.5",
"@pushrocks/consolecolor": "^2.0.1", "@pushrocks/consolecolor": "^2.0.1",
"@pushrocks/smartfile": "^6.0.6", "@pushrocks/smartfile": "^7.0.2",
"@pushrocks/smartlog": "^2.0.1", "@pushrocks/smartlog": "^2.0.19",
"@pushrocks/smartpromise": "^2.0.5", "@pushrocks/smartpromise": "^3.0.2",
"@pushrocks/smartshell": "^2.0.6", "@pushrocks/smartshell": "^2.0.13",
"@types/figures": "^2.0.0", "@types/figures": "^2.0.0",
"figures": "^2.0.0" "figures": "^2.0.0"
} }

26
readme.md Normal file
View File

@ -0,0 +1,26 @@
# @gitzone/tstest
a test utility to run tests that match test/**/*.ts
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@gitzone/tstest)
* [gitlab.com (source)](https://gitlab.com/gitzone/tstest)
* [github.com (source mirror)](https://github.com/gitzone/tstest)
* [docs (typedoc)](https://gitzone.gitlab.io/tstest/)
## Status for master
[![build status](https://gitlab.com/gitzone/tstest/badges/master/build.svg)](https://gitlab.com/gitzone/tstest/commits/master)
[![coverage report](https://gitlab.com/gitzone/tstest/badges/master/coverage.svg)](https://gitlab.com/gitzone/tstest/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@gitzone/tstest.svg)](https://www.npmjs.com/package/@gitzone/tstest)
[![Known Vulnerabilities](https://snyk.io/test/npm/@gitzone/tstest/badge.svg)](https://snyk.io/test/npm/@gitzone/tstest)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage
For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://gitzone.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)

View File

@ -14,7 +14,9 @@ export class TapCombinator {
} }
evaluate() { evaluate() {
console.log(`${logPrefixes.TsTestPrefix} RESULTS FOR ${this.tapParserStore.length} TESTFILE(S):`); console.log(
`${logPrefixes.TsTestPrefix} RESULTS FOR ${this.tapParserStore.length} TESTFILE(S):`
);
let failGlobal = false; // determine wether tstest should fail let failGlobal = false; // determine wether tstest should fail
for (const tapParser of this.tapParserStore) { for (const tapParser of this.tapParserStore) {

View File

@ -23,7 +23,6 @@ export class TapParser {
*/ */
constructor(public fileName: string) {} constructor(public fileName: string) {}
private _getNewTapTestResult() { private _getNewTapTestResult() {
this.activeTapTestResult = new TapTestResult(this.testStore.length + 1); this.activeTapTestResult = new TapTestResult(this.testStore.length + 1);
} }
@ -45,10 +44,7 @@ export class TapParser {
const regexResult = this.expectedTestsRegex.exec(logLine); const regexResult = this.expectedTestsRegex.exec(logLine);
this.expectedTests = parseInt(regexResult[2]); this.expectedTests = parseInt(regexResult[2]);
console.log( console.log(
`${logPrefixes.TapPrefix} ${cs( `${logPrefixes.TapPrefix} ${cs(`Expecting ${this.expectedTests} tests!`, 'blue')}`
`Expecting ${this.expectedTests} tests!`,
'blue'
)}`
); );
// initiating first TapResult // initiating first TapResult
@ -70,9 +66,7 @@ export class TapParser {
// test for protocol error // test for protocol error
if (testId !== this.activeTapTestResult.id) { if (testId !== this.activeTapTestResult.id) {
console.log( console.log(
`${ `${logPrefixes.TapErrorPrefix} Something is strange! Test Ids are not equal!`
logPrefixes.TapErrorPrefix
} Something is strange! Test Ids are not equal!`
); );
} }
this.activeTapTestResult.setTestResult(testOk); this.activeTapTestResult.setTestResult(testOk);
@ -128,9 +122,9 @@ export class TapParser {
* returns a test overview as string * returns a test overview as string
*/ */
getTestOverviewAsString() { getTestOverviewAsString() {
let overviewString = '' let overviewString = '';
for(let test of this.testStore) { for (let test of this.testStore) {
if(overviewString !== '') { if (overviewString !== '') {
overviewString += ' | '; overviewString += ' | ';
} }
if (test.testOk) { if (test.testOk) {
@ -161,29 +155,20 @@ export class TapParser {
if (this.expectedTests === this.receivedTests) { if (this.expectedTests === this.receivedTests) {
console.log( console.log(
`${logPrefixes.TapPrefix} ${cs( `${logPrefixes.TapPrefix} ${cs(
`${this.receivedTests} out of ${ `${this.receivedTests} out of ${this.expectedTests} Tests completed!`,
this.expectedTests
} Tests completed!`,
'green' 'green'
)}` )}`
); );
} else { } else {
console.log( console.log(
`${logPrefixes.TapErrorPrefix} ${cs( `${logPrefixes.TapErrorPrefix} ${cs(
`Only ${this.receivedTests} out of ${ `Only ${this.receivedTests} out of ${this.expectedTests} completed!`,
this.expectedTests
} completed!`,
'red' 'red'
)}` )}`
); );
} }
if (this.getErrorTests().length === 0) { if (this.getErrorTests().length === 0) {
console.log( console.log(`${logPrefixes.TapPrefix} ${cs(`All tests are successfull!!!`, 'green')}`);
`${logPrefixes.TapPrefix} ${cs(
`All tests are successfull!!!`,
'green'
)}`
);
} else { } else {
console.log( console.log(
`${logPrefixes.TapPrefix} ${cs( `${logPrefixes.TapPrefix} ${cs(

View File

@ -35,7 +35,16 @@ export class TsTest {
console.log(`${cs('=> ', 'blue')} Running ${cs(fileName, 'orange')}`); console.log(`${cs('=> ', 'blue')} Running ${cs(fileName, 'orange')}`);
console.log(cs(`=`.repeat(16), 'cyan')); console.log(cs(`=`.repeat(16), 'cyan'));
const tapParser = new TapParser(fileName); const tapParser = new TapParser(fileName);
const execResultStreaming = await smartshellInstance.execStreamingSilent(`tsrun ${fileName}`);
// tsrun options
let tsrunOptions = '';
if (process.argv.includes('--web')) {
tsrunOptions += ' --web';
}
const execResultStreaming = await smartshellInstance.execStreamingSilent(
`tsrun ${fileName}${tsrunOptions}`
);
await tapParser.handleTapProcess(execResultStreaming.childProcess); await tapParser.handleTapProcess(execResultStreaming.childProcess);
console.log(cs(`^`.repeat(16), 'cyan')); console.log(cs(`^`.repeat(16), 'cyan'));
console.log(''); // force new line console.log(''); // force new line

View File

@ -1,3 +1,17 @@
{ {
"extends": "tslint-config-standard" "extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
} }