Compare commits

..

26 Commits

Author SHA1 Message Date
da19d5de39 1.0.29 2020-06-01 18:40:22 +00:00
7380323186 fix(core): update 2020-06-01 18:40:22 +00:00
7a6923051f 1.0.28 2019-10-02 11:51:32 +02:00
0bac34dd37 fix(core): update 2019-10-02 11:51:31 +02:00
e10d9eb2a7 1.0.27 2019-10-02 11:18:45 +02:00
c5596f1a8f fix(core): update 2019-10-02 11:18:45 +02:00
ac0bb6f9b0 1.0.26 2019-10-02 10:59:54 +02:00
32db50ef1f fix(core): update 2019-10-02 10:59:53 +02:00
a35db70155 1.0.25 2019-10-02 10:56:03 +02:00
0286312855 fix(core): update 2019-10-02 10:56:02 +02:00
40cf6f72ce 1.0.24 2019-05-28 11:32:06 +02:00
e6c71a1350 fix(core): update 2019-05-28 11:32:06 +02:00
1c640b8545 1.0.23 2019-05-27 15:49:22 +02:00
8c4b591391 fix(core): update 2019-05-27 15:49:22 +02:00
8eb270ebbc 1.0.22 2019-05-27 13:14:31 +02:00
f6d47a1a67 fix(core): update 2019-05-27 13:14:31 +02:00
2a41acc6e4 1.0.21 2019-05-22 16:43:02 +02:00
fb6bb85441 fix(core): update 2019-05-22 16:43:02 +02:00
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
11 changed files with 2905 additions and 830 deletions

18
.gitignore vendored
View File

@ -1,6 +1,22 @@
.nogit/ .nogit/
node_modules/
# artifacts
coverage/ coverage/
public/ public/
pages/ pages/
# installs
node_modules/
# caches
.yarn/ .yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom

View File

@ -1,5 +1,5 @@
# gitzone standard # gitzone ci_default
image: hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache: cache:
paths: paths:
@ -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,38 +37,29 @@ 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: testStable:
stage: test
script:
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
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
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- priv
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv - notpriv
release: release:
@ -86,19 +78,12 @@ release:
# ==================== # ====================
codequality: codequality:
stage: metadata stage: metadata
image: docker:stable
allow_failure: true allow_failure: true
services:
- docker:stable-dind
script: script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - npmci command npm install -g tslint typescript
- docker run - npmci npm prepare
--env SOURCE_CODE="$PWD" - npmci npm install
--volume "$PWD":/code - npmci command "tslint -c tslint.json ./ts/**/*.ts"
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags: tags:
- docker - docker
- priv - priv
@ -114,12 +99,15 @@ trigger:
- notpriv - notpriv
pages: pages:
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-dbase:npmci
services:
- docker:stable-dind
stage: metadata stage: metadata
script: script:
- npmci command npm install -g typedoc typescript - npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install - npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/ - npmci command tsdoc
tags: tags:
- docker - docker
- notpriv - notpriv
@ -130,13 +118,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,16 @@
"npmci": { "npmci": {
"npmGlobalTools": [], "npmGlobalTools": [],
"npmAccessLevel": "public" "npmAccessLevel": "public"
},
"gitzone": {
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"gitscope": "gitzone",
"gitrepo": "tstest",
"shortDescription": "a test utility to run tests that match test/**/*.ts",
"npmPackagename": "@gitzone/tstest",
"license": "MIT"
}
} }
} }

3501
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,10 @@
{ {
"name": "@gitzone/tstest", "name": "@gitzone/tstest",
"version": "1.0.16", "version": "1.0.29",
"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_ts/index.js",
"typings": "dist/index.d.ts", "typings": "dist_ts/index.d.ts",
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"bin": { "bin": {
@ -19,17 +19,29 @@
"build": "(tsbuild)" "build": "(tsbuild)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.2", "@gitzone/tsbuild": "^2.1.17",
"@pushrocks/tapbundle": "^3.0.7" "@pushrocks/tapbundle": "^3.0.13"
}, },
"dependencies": { "dependencies": {
"@gitzone/tsrun": "^1.1.16", "@gitzone/tsbundle": "^1.0.69",
"@gitzone/tsrun": "^1.2.10",
"@pushrocks/consolecolor": "^2.0.1", "@pushrocks/consolecolor": "^2.0.1",
"@pushrocks/smartfile": "^6.0.11", "@pushrocks/smartfile": "^7.0.6",
"@pushrocks/smartlog": "^2.0.9", "@pushrocks/smartlog": "^2.0.19",
"@pushrocks/smartpromise": "^2.0.5", "@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartshell": "^2.0.11", "@pushrocks/smartshell": "^2.0.25",
"@types/figures": "^2.0.0", "@types/figures": "^3.0.1",
"figures": "^2.0.0" "figures": "^3.0.0"
} },
"files": [
"ts/*",
"ts_web/*",
"dist/*",
"dist_web/*",
"dist_ts_web/*",
"assets/*",
"cli.js",
"npmextra.json",
"readme.md"
]
} }

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)
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.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

@ -41,7 +41,7 @@ export class TestDirectory {
private async _init() { private async _init() {
this.testfileArray = await plugins.smartfile.fs.fileTreeToObject( this.testfileArray = await plugins.smartfile.fs.fileTreeToObject(
plugins.path.join(this.cwd, this.relativePath), plugins.path.join(this.cwd, this.relativePath),
'**/*.ts' 'test*.ts'
); );
} }

View File

@ -37,12 +37,14 @@ export class TsTest {
const tapParser = new TapParser(fileName); const tapParser = new TapParser(fileName);
// tsrun options // tsrun options
let tsrunOptions = '' let tsrunOptions = '';
if(process.argv.includes('--web')) { if (process.argv.includes('--web')) {
tsrunOptions += ' --web' tsrunOptions += ' --web';
} }
const execResultStreaming = await smartshellInstance.execStreamingSilent(`tsrun ${fileName}${tsrunOptions}`); 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"
} }