fix(core): update

This commit is contained in:
Philipp Kunz 2021-01-26 02:35:02 +00:00
parent 715108b11b
commit 1eaf1e9a77
7 changed files with 2174 additions and 1656 deletions

View File

@ -19,23 +19,35 @@ mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
audit:
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high
- npmci command npm audit --audit-level=high --only=dev
tags:
- lossless
- docker
- notpriv
allow_failure: true
# ====================
# test stage
@ -50,9 +62,7 @@ testStable:
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- priv
testBuild:
stage: test
@ -63,9 +73,7 @@ testBuild:
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- notpriv
release:
stage: release
@ -85,6 +93,8 @@ release:
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci npm prepare

View File

@ -15,7 +15,7 @@
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm"]
"enum": ["website", "element", "service", "npm", "wcc"]
}
}
}

3766
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -20,19 +20,19 @@
},
"homepage": "https://gitlab.com/pushrocks/tapbundle#README",
"dependencies": {
"@pushrocks/smartdelay": "^2.0.9",
"@pushrocks/smartenv": "^4.0.10",
"@pushrocks/smartpromise": "^3.0.2",
"@pushrocks/smarttime": "^3.0.19",
"@pushrocks/smartdelay": "^2.0.10",
"@pushrocks/smartenv": "^4.0.16",
"@pushrocks/smartpromise": "^3.1.3",
"@pushrocks/smarttime": "^3.0.38",
"smartchai": "^2.0.1"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.24",
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tsrun": "^1.2.12",
"@gitzone/tstest": "^1.0.41",
"@types/node": "^14.0.22",
"@gitzone/tstest": "^1.0.52",
"@types/node": "^14.14.22",
"randomstring": "^1.1.5",
"tslint": "^6.1.2",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
},
"files": [
@ -50,4 +50,4 @@
"browserslist": [
"last 1 chrome versions"
]
}
}

View File

@ -15,9 +15,11 @@ const test2 = tap.test('my second test', async (tools) => {
const test3 = tap.test(
'my third test -> test2 should take longer than test1 and endure at least 1000ms',
async () => {
expect((await test1).hrtMeasurement.milliSeconds < (await test2).hrtMeasurement.milliSeconds).to
.be.true;
expect((await test2).hrtMeasurement.milliSeconds > 1000).to.be.true;
expect(
(await test1.testPromise).hrtMeasurement.milliSeconds <
(await test2).hrtMeasurement.milliSeconds
).to.be.true;
expect((await test2.testPromise).hrtMeasurement.milliSeconds > 1000).to.be.true;
}
);

View File

@ -34,7 +34,7 @@ export class Tap {
* @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects
*/
public async test(
public test(
testDescription: string,
testFunction: ITestFunction,
modeArg: 'normal' | 'only' | 'skip' = 'normal'

View File

@ -20,8 +20,10 @@ export class TapTest {
public tapTools: TapTools;
public testFunction: ITestFunction;
public testKey: number; // the testKey the position in the test qeue. Set upon calling .run()
public testDeferred: Deferred<TapTest> = plugins.smartpromise.defer();
private testDeferred: Deferred<TapTest> = plugins.smartpromise.defer();
public testPromise: Promise<TapTest> = this.testDeferred.promise;
private testResultDeferred: Deferred<any> = plugins.smartpromise.defer();
public testResultPromise: Promise<any> = this.testResultDeferred.promise;
/**
* constructor
*/
@ -42,7 +44,7 @@ export class TapTest {
this.testKey = testKeyArg;
const testNumber = testKeyArg + 1;
try {
await this.testFunction(this.tapTools);
const testReturnValue = await this.testFunction(this.tapTools);
if (this.status === 'timeout') {
throw new Error('Test succeeded, but timed out...');
}
@ -52,12 +54,14 @@ export class TapTest {
);
this.status = 'success';
this.testDeferred.resolve(this);
this.testResultDeferred.resolve(testReturnValue);
} catch (err) {
this.hrtMeasurement.stop();
console.log(
`not ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`
);
this.testDeferred.resolve(this);
this.testResultDeferred.resolve(err);
// if the test has already succeeded before
if (this.status === 'success') {