fix(core): fix node 10.x.x compatibility

This commit is contained in:
Phil Kunz 2018-06-28 23:34:41 +02:00
parent 0028c5492b
commit 3199943b59
31 changed files with 681 additions and 1096 deletions

View File

@ -3,23 +3,39 @@ image: hosttoday/ht-docker-node:npmci
cache: cache:
paths: paths:
- .yarn/ - .npmci_cache/
key: "$CI_BUILD_STAGE" key: "$CI_BUILD_STAGE"
stages: stages:
- mirror - security
- test - test
- release - release
- trigger - metadata
- pages
# ====================
# security stage
# ====================
mirror: mirror:
stage: mirror stage: security
script: script:
- npmci git mirror - npmci git mirror
tags: tags:
- docker - docker
- notpriv
snyk:
stage: security
script:
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
# ====================
# test stage
# ====================
testLEGACY: testLEGACY:
stage: test stage: test
script: script:
@ -29,6 +45,7 @@ testLEGACY:
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- notpriv
allow_failure: true allow_failure: true
testLTS: testLTS:
@ -40,6 +57,7 @@ testLTS:
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- notpriv
testSTABLE: testSTABLE:
stage: test stage: test
@ -50,37 +68,74 @@ testSTABLE:
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- notpriv
release: release:
stage: release stage: release
script: script:
- npmci npm prepare - npmci node install stable
- npmci npm publish - npmci npm publish
only: only:
- tags - tags
tags: tags:
- docker - docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--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:
- docker
- priv
trigger: trigger:
stage: trigger stage: metadata
script: script:
- npmci trigger - npmci trigger
only: only:
- tags - tags
tags: tags:
- docker - docker
- notpriv
pages: pages:
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-node:npmci
stage: pages stage: metadata
script: script:
- npmci command yarn global add npmpage - npmci command npm install -g npmpage
- npmci command npmpage - npmci command npmpage
tags: tags:
- docker - docker
- notpriv
only: only:
- tags - tags
artifacts: artifacts:
expire_in: 1 week expire_in: 1 week
paths: paths:
- public - public
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

@ -1,13 +1,16 @@
# tapbundle # tapbundle
tap bundled for tapbuffer tap bundled for tapbuffer
## Availabililty ## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/tapbundle) [![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/tapbundle)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/tapbundle) [![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/tapbundle)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/tapbundle) [![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/tapbundle)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/tapbundle/) [![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/tapbundle/)
## Status for master ## Status for master
[![build status](https://GitLab.com/pushrocks/tapbundle/badges/master/build.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master) [![build status](https://GitLab.com/pushrocks/tapbundle/badges/master/build.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master)
[![coverage report](https://GitLab.com/pushrocks/tapbundle/badges/master/coverage.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master) [![coverage report](https://GitLab.com/pushrocks/tapbundle/badges/master/coverage.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/tapbundle.svg)](https://www.npmjs.com/package/tapbundle) [![npm downloads per month](https://img.shields.io/npm/dm/tapbundle.svg)](https://www.npmjs.com/package/tapbundle)
@ -21,6 +24,6 @@ tap bundled for tapbuffer
For further information read the linked docs at the top of this README. For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html) > | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks) [![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

2
dist/index.d.ts vendored
View File

@ -1,2 +0,0 @@
export { expect } from 'smartchai';
export { tap } from './tapbundle.classes.tap';

7
dist/index.js vendored
View File

@ -1,7 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var smartchai_1 = require("smartchai");
exports.expect = smartchai_1.expect;
var tapbundle_classes_tap_1 = require("./tapbundle.classes.tap");
exports.tap = tapbundle_classes_tap_1.tap;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHVDQUFrQztBQUF6Qiw2QkFBQSxNQUFNLENBQUE7QUFDZixpRUFBNkM7QUFBcEMsc0NBQUEsR0FBRyxDQUFBIn0=

View File

@ -1,38 +0,0 @@
import { TapTest, ITestFunction } from './tapbundle.classes.taptest';
import { TapWrap, ITapWrapFunction } from './tapbundle.classes.tapwrap';
export declare class Tap {
/**
* skip a test
*/
skip: {
test: (descriptionArg: string, functionArg: ITestFunction) => void;
};
private _tapTests;
/**
* Normal test function, will run one by one
* @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects
*/
test(testDescription: string, testFunction: ITestFunction): Promise<TapTest>;
/**
* wraps function
*/
wrap(functionArg: ITapWrapFunction): TapWrap;
/**
* A parallel test that will not be waited for before the next starts.
* @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects
*/
testParallel(testDescription: string, testFunction: ITestFunction): void;
/**
* starts the test evaluation
*/
start(optionsArg?: {
throwOnError: boolean;
}): Promise<void>;
/**
* handle errors
*/
threw(err: any): void;
}
export declare let tap: Tap;

View File

@ -1,111 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const tapbundle_classes_taptest_1 = require("./tapbundle.classes.taptest");
const tapbundle_classes_tapwrap_1 = require("./tapbundle.classes.tapwrap");
class Tap {
constructor() {
/**
* skip a test
*/
this.skip = {
test: (descriptionArg, functionArg) => {
console.log(`skipped test: ${descriptionArg}`);
}
};
this._tapTests = [];
}
/**
* Normal test function, will run one by one
* @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects
*/
test(testDescription, testFunction) {
return __awaiter(this, void 0, void 0, function* () {
let localTest = new tapbundle_classes_taptest_1.TapTest({
description: testDescription,
testFunction: testFunction,
parallel: false
});
this._tapTests.push(localTest);
return localTest;
});
}
/**
* wraps function
*/
wrap(functionArg) {
return new tapbundle_classes_tapwrap_1.TapWrap(functionArg);
}
/**
* A parallel test that will not be waited for before the next starts.
* @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects
*/
testParallel(testDescription, testFunction) {
this._tapTests.push(new tapbundle_classes_taptest_1.TapTest({
description: testDescription,
testFunction: testFunction,
parallel: true
}));
}
/**
* starts the test evaluation
*/
start(optionsArg) {
return __awaiter(this, void 0, void 0, function* () {
let promiseArray = [];
// safeguard against empty test array
if (this._tapTests.length === 0) {
console.log('no tests specified. Ending here!');
return;
}
console.log(`1..${this._tapTests.length}`);
for (let testKey = 0; testKey < this._tapTests.length; testKey++) {
let currentTest = this._tapTests[testKey];
let testPromise = currentTest.run(testKey);
if (currentTest.parallel) {
promiseArray.push(testPromise);
}
else {
yield testPromise;
}
}
yield Promise.all(promiseArray);
// when tests have been run and all promises are fullfilled
let failReasons = [];
let executionNotes = [];
// collect failed tests
for (let tapTest of this._tapTests) {
if (tapTest.status !== 'success') {
failReasons.push(`Test ${tapTest.testKey + 1} failed with status ${tapTest.status}:\n`
+ `|| ${tapTest.description}\n`
+ `|| for more information please take a look the logs above`);
}
}
// render fail Reasons
for (let failReason of failReasons) {
console.log(failReason);
}
if (optionsArg && optionsArg.throwOnError && failReasons.length > 0) {
process.exit(1);
}
});
}
/**
* handle errors
*/
threw(err) {
console.log(err);
}
}
exports.Tap = Tap;
exports.tap = new Tap();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLmNsYXNzZXMudGFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdGFwYnVuZGxlLmNsYXNzZXMudGFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFFQSwyRUFBb0U7QUFDcEUsMkVBQXVFO0FBQ3ZFO0lBQUE7UUFFRTs7V0FFRztRQUNILFNBQUksR0FBRztZQUNMLElBQUksRUFBRSxDQUFDLGNBQXNCLEVBQUUsV0FBMEIsRUFBRSxFQUFFO2dCQUMzRCxPQUFPLENBQUMsR0FBRyxDQUFDLGlCQUFpQixjQUFjLEVBQUUsQ0FBQyxDQUFBO1lBQ2hELENBQUM7U0FDRixDQUFBO1FBRU8sY0FBUyxHQUFjLEVBQUUsQ0FBQTtJQTZGbkMsQ0FBQztJQTNGQzs7OztPQUlHO0lBQ0csSUFBSSxDQUFFLGVBQXVCLEVBQUUsWUFBMkI7O1lBQzlELElBQUksU0FBUyxHQUFHLElBQUksbUNBQU8sQ0FBQztnQkFDMUIsV0FBVyxFQUFFLGVBQWU7Z0JBQzVCLFlBQVksRUFBRSxZQUFZO2dCQUMxQixRQUFRLEVBQUUsS0FBSzthQUNoQixDQUFDLENBQUE7WUFDRixJQUFJLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQTtZQUM5QixNQUFNLENBQUMsU0FBUyxDQUFBO1FBQ2xCLENBQUM7S0FBQTtJQUVEOztPQUVHO0lBQ0gsSUFBSSxDQUFFLFdBQTZCO1FBQ2pDLE1BQU0sQ0FBQyxJQUFJLG1DQUFPLENBQUMsV0FBVyxDQUFDLENBQUE7SUFDakMsQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxZQUFZLENBQUUsZUFBdUIsRUFBRSxZQUEyQjtRQUNoRSxJQUFJLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxJQUFJLG1DQUFPLENBQUM7WUFDOUIsV0FBVyxFQUFFLGVBQWU7WUFDNUIsWUFBWSxFQUFFLFlBQVk7WUFDMUIsUUFBUSxFQUFFLElBQUk7U0FDZixDQUFDLENBQUMsQ0FBQTtJQUNMLENBQUM7SUFFRDs7T0FFRztJQUNHLEtBQUssQ0FBQyxVQUVYOztZQUNDLElBQUksWUFBWSxHQUFtQixFQUFFLENBQUE7WUFFckMscUNBQXFDO1lBQ3JDLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUM7Z0JBQ2hDLE9BQU8sQ0FBQyxHQUFHLENBQUMsa0NBQWtDLENBQUMsQ0FBQTtnQkFDL0MsTUFBTSxDQUFBO1lBQ1IsQ0FBQztZQUVELE9BQU8sQ0FBQyxHQUFHLENBQUMsTUFBTSxJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUE7WUFDMUMsR0FBRyxDQUFDLENBQUMsSUFBSSxPQUFPLEdBQUcsQ0FBQyxFQUFFLE9BQU8sR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sRUFBRSxPQUFPLEVBQUUsRUFBRSxDQUFDO2dCQUNqRSxJQUFJLFdBQVcsR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFBO2dCQUN6QyxJQUFJLFdBQVcsR0FBRyxXQUFXLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFBO2dCQUMxQyxFQUFFLENBQUMsQ0FBQyxXQUFXLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQztvQkFDekIsWUFBWSxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQTtnQkFDaEMsQ0FBQztnQkFBQyxJQUFJLENBQUMsQ0FBQztvQkFDTixNQUFNLFdBQVcsQ0FBQTtnQkFDbkIsQ0FBQztZQUNILENBQUM7WUFDRCxNQUFNLE9BQU8sQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDLENBQUE7WUFFL0IsMkRBQTJEO1lBQzNELElBQUksV0FBVyxHQUFhLEVBQUUsQ0FBQTtZQUM5QixJQUFJLGNBQWMsR0FBYSxFQUFFLENBQUE7WUFDakMsdUJBQXVCO1lBQ3ZCLEdBQUcsQ0FBQyxDQUFDLElBQUksT0FBTyxJQUFJLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDO2dCQUNuQyxFQUFFLENBQUMsQ0FBQyxPQUFPLENBQUMsTUFBTSxLQUFLLFNBQVMsQ0FBQyxDQUFDLENBQUM7b0JBQ2pDLFdBQVcsQ0FBQyxJQUFJLENBQ2QsUUFBUSxPQUFPLENBQUMsT0FBTyxHQUFHLENBQUMsdUJBQXVCLE9BQU8sQ0FBQyxNQUFNLEtBQUs7MEJBQ25FLE1BQU0sT0FBTyxDQUFDLFdBQVcsSUFBSTswQkFDN0IsMkRBQTJELENBQzlELENBQUE7Z0JBQ0gsQ0FBQztZQUNILENBQUM7WUFFRCxzQkFBc0I7WUFDdEIsR0FBRyxDQUFDLENBQUMsSUFBSSxVQUFVLElBQUksV0FBVyxDQUFDLENBQUMsQ0FBQztnQkFDbkMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQTtZQUN6QixDQUFDO1lBRUQsRUFBRSxDQUFDLENBQUMsVUFBVSxJQUFJLFVBQVUsQ0FBQyxZQUFZLElBQUksV0FBVyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO2dCQUNwRSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFBO1lBQ2pCLENBQUM7UUFDSCxDQUFDO0tBQUE7SUFFRDs7T0FFRztJQUNILEtBQUssQ0FBRSxHQUFHO1FBQ1IsT0FBTyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQTtJQUNsQixDQUFDO0NBQ0Y7QUF4R0Qsa0JBd0dDO0FBRVUsUUFBQSxHQUFHLEdBQUcsSUFBSSxHQUFHLEVBQUUsQ0FBQSJ9

View File

@ -1,31 +0,0 @@
import { TapTools } from './tapbundle.classes.taptools';
import { HrtMeasurement } from 'early';
import { Deferred } from 'smartq';
export declare type TTestStatus = 'success' | 'error' | 'pending' | 'errorAfterSuccess' | 'timeout';
export interface ITestFunction {
(tapTools?: TapTools): Promise<any>;
}
export declare class TapTest {
description: string;
failureAllowed: boolean;
hrtMeasurement: HrtMeasurement;
parallel: boolean;
status: TTestStatus;
tapTools: TapTools;
testFunction: ITestFunction;
testKey: number;
testDeferred: Deferred<TapTest>;
testPromise: Promise<TapTest>;
/**
* constructor
*/
constructor(optionsArg: {
description: string;
testFunction: ITestFunction;
parallel: boolean;
});
/**
* run the test
*/
run(testKeyArg: number): Promise<void>;
}

View File

@ -1,69 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./tapbundle.plugins");
const tapbundle_classes_taptools_1 = require("./tapbundle.classes.taptools");
// imported interfaces
const early_1 = require("early");
class TapTest {
/**
* constructor
*/
constructor(optionsArg) {
this.testDeferred = plugins.smartq.defer();
this.testPromise = this.testDeferred.promise;
this.description = optionsArg.description;
this.hrtMeasurement = new early_1.HrtMeasurement();
this.parallel = optionsArg.parallel;
this.status = 'pending';
this.tapTools = new tapbundle_classes_taptools_1.TapTools(this);
this.testFunction = optionsArg.testFunction;
}
/**
* run the test
*/
run(testKeyArg) {
return __awaiter(this, void 0, void 0, function* () {
this.hrtMeasurement.start();
this.testKey = testKeyArg;
let testNumber = testKeyArg + 1;
try {
yield this.testFunction(this.tapTools);
if (this.status === 'timeout') {
throw new Error('Test succeeded, but timed out...');
}
this.hrtMeasurement.stop();
console.log(`ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`);
this.status = 'success';
this.testDeferred.resolve(this);
}
catch (err) {
this.hrtMeasurement.stop();
console.log(`not ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`);
this.testDeferred.resolve(this);
// if the test has already succeeded before
if (this.status === 'success') {
this.status = 'errorAfterSuccess';
console.log('!!! ALERT !!!: weird behaviour, since test has been already successfull');
}
else {
this.status = 'error';
}
// if the test is allowed to fail
if (this.failureAllowed) {
console.log(`please note: failure allowed!`);
}
console.log(err);
}
});
}
}
exports.TapTest = TapTest;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLmNsYXNzZXMudGFwdGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3RhcGJ1bmRsZS5jbGFzc2VzLnRhcHRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLCtDQUE4QztBQUU5Qyw2RUFBdUQ7QUFFdkQsc0JBQXNCO0FBQ3RCLGlDQUFzQztBQVd0QztJQVdFOztPQUVHO0lBQ0gsWUFBYSxVQUlaO1FBVEQsaUJBQVksR0FBc0IsT0FBTyxDQUFDLE1BQU0sQ0FBQyxLQUFLLEVBQUUsQ0FBQTtRQUN4RCxnQkFBVyxHQUFxQixJQUFJLENBQUMsWUFBWSxDQUFDLE9BQU8sQ0FBQTtRQVN2RCxJQUFJLENBQUMsV0FBVyxHQUFHLFVBQVUsQ0FBQyxXQUFXLENBQUE7UUFDekMsSUFBSSxDQUFDLGNBQWMsR0FBRyxJQUFJLHNCQUFjLEVBQUUsQ0FBQTtRQUMxQyxJQUFJLENBQUMsUUFBUSxHQUFHLFVBQVUsQ0FBQyxRQUFRLENBQUE7UUFDbkMsSUFBSSxDQUFDLE1BQU0sR0FBRyxTQUFTLENBQUE7UUFDdkIsSUFBSSxDQUFDLFFBQVEsR0FBRyxJQUFJLHFDQUFRLENBQUMsSUFBSSxDQUFDLENBQUE7UUFDbEMsSUFBSSxDQUFDLFlBQVksR0FBRyxVQUFVLENBQUMsWUFBWSxDQUFBO0lBQzdDLENBQUM7SUFFRDs7T0FFRztJQUNHLEdBQUcsQ0FBRSxVQUFrQjs7WUFDM0IsSUFBSSxDQUFDLGNBQWMsQ0FBQyxLQUFLLEVBQUUsQ0FBQTtZQUMzQixJQUFJLENBQUMsT0FBTyxHQUFHLFVBQVUsQ0FBQTtZQUN6QixJQUFJLFVBQVUsR0FBRyxVQUFVLEdBQUcsQ0FBQyxDQUFBO1lBQy9CLElBQUksQ0FBQztnQkFDSCxNQUFNLElBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFBO2dCQUN0QyxFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsTUFBTSxLQUFLLFNBQVMsQ0FBQyxDQUFDLENBQUM7b0JBQzlCLE1BQU0sSUFBSSxLQUFLLENBQUUsa0NBQWtDLENBQUMsQ0FBQTtnQkFDdEQsQ0FBQztnQkFDRCxJQUFJLENBQUMsY0FBYyxDQUFDLElBQUksRUFBRSxDQUFBO2dCQUMxQixPQUFPLENBQUMsR0FBRyxDQUFDLE1BQU0sVUFBVSxNQUFNLElBQUksQ0FBQyxXQUFXLFdBQVcsSUFBSSxDQUFDLGNBQWMsQ0FBQyxZQUFZLElBQUksQ0FBQyxDQUFBO2dCQUNsRyxJQUFJLENBQUMsTUFBTSxHQUFHLFNBQVMsQ0FBQTtnQkFDdkIsSUFBSSxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUE7WUFDakMsQ0FBQztZQUFDLEtBQUssQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7Z0JBQ2IsSUFBSSxDQUFDLGNBQWMsQ0FBQyxJQUFJLEVBQUUsQ0FBQTtnQkFDMUIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxVQUFVLFVBQVUsTUFBTSxJQUFJLENBQUMsV0FBVyxXQUFXLElBQUksQ0FBQyxjQUFjLENBQUMsWUFBWSxJQUFJLENBQUMsQ0FBQTtnQkFDdEcsSUFBSSxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUE7Z0JBRS9CLDJDQUEyQztnQkFDM0MsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLE1BQU0sS0FBSyxTQUFTLENBQUMsQ0FBQyxDQUFDO29CQUM5QixJQUFJLENBQUMsTUFBTSxHQUFHLG1CQUFtQixDQUFBO29CQUNqQyxPQUFPLENBQUMsR0FBRyxDQUFDLHlFQUF5RSxDQUFDLENBQUE7Z0JBQ3hGLENBQUM7Z0JBQUMsSUFBSSxDQUFDLENBQUM7b0JBQ04sSUFBSSxDQUFDLE1BQU0sR0FBRyxPQUFPLENBQUE7Z0JBQ3ZCLENBQUM7Z0JBRUQsaUNBQWlDO2dCQUNqQyxFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLENBQUMsQ0FBQztvQkFDeEIsT0FBTyxDQUFDLEdBQUcsQ0FBQywrQkFBK0IsQ0FBQyxDQUFBO2dCQUM5QyxDQUFDO2dCQUNELE9BQU8sQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUE7WUFDbEIsQ0FBQztRQUNILENBQUM7S0FBQTtDQUNGO0FBL0RELDBCQStEQyJ9

View File

@ -1,22 +0,0 @@
export interface IPromiseFunc {
(): Promise<any>;
}
export declare class TapTools {
/**
* the referenced TapTest
*/
private _tapTest;
constructor(TapTestArg: any);
/**
* allow failure
*/
allowFailure(): void;
/**
* async/await delay method
*/
delayFor(timeMilliArg: any): Promise<void>;
delayForRandom(timeMilliMinArg: any, timeMilliMaxArg: any): Promise<void>;
timeout(timeMilliArg: number): Promise<void>;
checkIterationLeak(iterationfuncArg: IPromiseFunc): Promise<void>;
returnError(throwingFuncArg: IPromiseFunc): Promise<Error>;
}

View File

@ -1,64 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./tapbundle.plugins");
class TapTools {
constructor(TapTestArg) {
this._tapTest = TapTestArg;
}
/**
* allow failure
*/
allowFailure() {
this._tapTest.failureAllowed = true;
}
/**
* async/await delay method
*/
delayFor(timeMilliArg) {
return __awaiter(this, void 0, void 0, function* () {
yield plugins.smartdelay.delayFor(timeMilliArg);
});
}
delayForRandom(timeMilliMinArg, timeMilliMaxArg) {
return __awaiter(this, void 0, void 0, function* () {
yield plugins.smartdelay.delayForRandom(timeMilliMinArg, timeMilliMaxArg);
});
}
timeout(timeMilliArg) {
return __awaiter(this, void 0, void 0, function* () {
let timeout = new plugins.smartdelay.Timeout(timeMilliArg);
timeout.makeUnrefed();
yield timeout.promise;
if (this._tapTest.status === 'pending') {
this._tapTest.status = 'timeout';
}
});
}
checkIterationLeak(iterationfuncArg) {
return __awaiter(this, void 0, void 0, function* () {
yield plugins.leakage.iterate.async(iterationfuncArg);
});
}
returnError(throwingFuncArg) {
return __awaiter(this, void 0, void 0, function* () {
let funcErr;
try {
yield throwingFuncArg();
}
catch (err) {
funcErr = err;
}
return funcErr;
});
}
}
exports.TapTools = TapTools;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLmNsYXNzZXMudGFwdG9vbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90YXBidW5kbGUuY2xhc3Nlcy50YXB0b29scy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsK0NBQThDO0FBTzlDO0lBT0UsWUFBYSxVQUFVO1FBQ3JCLElBQUksQ0FBQyxRQUFRLEdBQUcsVUFBVSxDQUFBO0lBQzVCLENBQUM7SUFFRDs7T0FFRztJQUNILFlBQVk7UUFDVixJQUFJLENBQUMsUUFBUSxDQUFDLGNBQWMsR0FBRyxJQUFJLENBQUE7SUFDckMsQ0FBQztJQUVEOztPQUVHO0lBQ0csUUFBUSxDQUFFLFlBQVk7O1lBQzFCLE1BQU0sT0FBTyxDQUFDLFVBQVUsQ0FBQyxRQUFRLENBQUMsWUFBWSxDQUFDLENBQUE7UUFDakQsQ0FBQztLQUFBO0lBRUssY0FBYyxDQUFFLGVBQWUsRUFBRSxlQUFlOztZQUNwRCxNQUFNLE9BQU8sQ0FBQyxVQUFVLENBQUMsY0FBYyxDQUFDLGVBQWUsRUFBRSxlQUFlLENBQUMsQ0FBQTtRQUMzRSxDQUFDO0tBQUE7SUFFSyxPQUFPLENBQUUsWUFBb0I7O1lBQ2pDLElBQUksT0FBTyxHQUFHLElBQUksT0FBTyxDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsWUFBWSxDQUFDLENBQUE7WUFDMUQsT0FBTyxDQUFDLFdBQVcsRUFBRSxDQUFBO1lBQ3JCLE1BQU0sT0FBTyxDQUFDLE9BQU8sQ0FBQTtZQUNyQixFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLE1BQU0sS0FBSyxTQUFTLENBQUMsQ0FBQyxDQUFDO2dCQUN2QyxJQUFJLENBQUMsUUFBUSxDQUFDLE1BQU0sR0FBRyxTQUFTLENBQUE7WUFDbEMsQ0FBQztRQUNILENBQUM7S0FBQTtJQUVLLGtCQUFrQixDQUFFLGdCQUE4Qjs7WUFDdEQsTUFBTSxPQUFPLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsZ0JBQWdCLENBQUMsQ0FBQTtRQUN2RCxDQUFDO0tBQUE7SUFFSyxXQUFXLENBQUUsZUFBNkI7O1lBQzlDLElBQUksT0FBYyxDQUFBO1lBQ2xCLElBQUksQ0FBQztnQkFDSCxNQUFNLGVBQWUsRUFBRSxDQUFBO1lBQ3pCLENBQUM7WUFBQyxLQUFLLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO2dCQUNiLE9BQU8sR0FBRyxHQUFHLENBQUE7WUFDZixDQUFDO1lBQ0QsTUFBTSxDQUFDLE9BQU8sQ0FBQTtRQUNoQixDQUFDO0tBQUE7Q0FDRjtBQW5ERCw0QkFtREMifQ==

View File

@ -1,14 +0,0 @@
export interface ITapWrapFunction {
(): Promise<any>;
}
export declare class TapWrap {
wrapFunction: ITapWrapFunction;
/**
* the constructor
*/
constructor(wrapFunctionArg: ITapWrapFunction);
/**
* run the wrapFunction
*/
run(): Promise<void>;
}

View File

@ -1,29 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
class TapWrap {
/**
* the constructor
*/
constructor(wrapFunctionArg) {
// nothing here
this.wrapFunction = wrapFunctionArg;
}
/**
* run the wrapFunction
*/
run() {
return __awaiter(this, void 0, void 0, function* () {
yield this.wrapFunction();
});
}
}
exports.TapWrap = TapWrap;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLmNsYXNzZXMudGFwd3JhcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3RhcGJ1bmRsZS5jbGFzc2VzLnRhcHdyYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQU1BO0lBR0U7O09BRUc7SUFDSCxZQUFhLGVBQWlDO1FBQzVDLGVBQWU7UUFDZixJQUFJLENBQUMsWUFBWSxHQUFHLGVBQWUsQ0FBQTtJQUNyQyxDQUFDO0lBRUQ7O09BRUc7SUFDRyxHQUFHOztZQUNQLE1BQU0sSUFBSSxDQUFDLFlBQVksRUFBRSxDQUFBO1FBQzNCLENBQUM7S0FBQTtDQUNGO0FBakJELDBCQWlCQyJ9

View File

@ -1,5 +0,0 @@
import * as early from 'early';
import * as leakage from 'leakage';
import * as smartdelay from 'smartdelay';
import * as smartq from 'smartq';
export { early, smartdelay, smartq, leakage };

View File

@ -1,11 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const early = require("early");
exports.early = early;
const leakage = require("leakage");
exports.leakage = leakage;
const smartdelay = require("smartdelay");
exports.smartdelay = smartdelay;
const smartq = require("smartq");
exports.smartq = smartq;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90YXBidW5kbGUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLCtCQUE4QjtBQU01QixzQkFBSztBQUxQLG1DQUFrQztBQVFoQywwQkFBTztBQVBULHlDQUF3QztBQUt0QyxnQ0FBVTtBQUpaLGlDQUFnQztBQUs5Qix3QkFBTSJ9

View File

@ -1,3 +0,0 @@
export declare class TapCreator {
}
export declare let tapCreator: TapCreator;

View File

@ -1,7 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class TapCreator {
}
exports.TapCreator = TapCreator;
exports.tapCreator = new TapCreator();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLnRhcGNyZWF0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90YXBidW5kbGUudGFwY3JlYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBO0NBRUM7QUFGRCxnQ0FFQztBQUVVLFFBQUEsVUFBVSxHQUFHLElBQUksVUFBVSxFQUFFLENBQUEifQ==

View File

@ -1,55 +1,56 @@
# Get Started # Get Started
## TypeScript ## TypeScript
Use TypeScript for best in class instellisense. Use TypeScript for best in class instellisense.
A few words on TypeScript A few words on TypeScript
## Included in this package ## Included in this package
* tap compatible testing framework written in TypeScript - tap compatible testing framework written in TypeScript
* a collection of test tools - a collection of test tools
* **code** testing framework with typings - **code** testing framework with typings
## Write your first tests ## Write your first tests
``` javascript
import {tap, expect} from 'tapbundle' // has typings in place
import * as myAwesomeModuleToTest from '../dist/index' // '../dist/index' is the standard path for npmts modules ```javascript
import { tap, expect } from 'tapbundle'; // has typings in place
tap.test('my awesome description', async (tools) => { // tools are optional parameter import * as myAwesomeModuleToTest from '../dist/index'; // '../dist/index' is the standard path for npmts modules
tools.timeout(2000) // test will fail if it takes longer than 2000 millisenconds
})
let myTest2 = tap.test('my awesome test 2', async (tools) => { tap.test('my awesome description', async tools => {
myAwsomeModuleToTest.doSomethingAsync() // we don't wait here // tools are optional parameter
await tools.delayFor(3000) // yay! :) promise based timeouts :) tools.timeout(2000); // test will fail if it takes longer than 2000 millisenconds
console.log('This gets logged 3000 ms into the test') });
})
tap.test('my awesome test 3', async (tools) => { let myTest2 = tap.test('my awesome test 2', async tools => {
expect(true).to.be.true // will not throw myAwsomeModuleToTest.doSomethingAsync(); // we don't wait here
await expect(tools.delayFor(2000)).to.eventually.be.fulfilled // yay expect promises :) await tools.delayFor(3000); // yay! :) promise based timeouts :)
expect((await myTest2.promise).hrtMeasurement.milliSeconds > 1000).to.be.true // access other tests metadata :) console.log('This gets logged 3000 ms into the test');
}) });
let myTest4 = tap.testParallel('my awesome test 4', async (tools) => { tap.test('my awesome test 3', async tools => {
await tools.delayFor(4000) expect(true).to.be.true; // will not throw
console.log('logs to console after 4 seconds into this test') await expect(tools.delayFor(2000)).to.eventually.be.fulfilled; // yay expect promises :)
}) expect((await myTest2.promise).hrtMeasurement.milliSeconds > 1000).to.be.true; // access other tests metadata :)
});
let myTest4 = tap.testParallel('my awesome test 4', async tools => {
await tools.delayFor(4000);
console.log('logs to console after 4 seconds into this test');
});
tap.test('my awesome test 5', async () => { tap.test('my awesome test 5', async () => {
expect(myTest4.status).to.equal('pending') // since this test will likely finish before myTest4. expect(myTest4.status).to.equal('pending'); // since this test will likely finish before myTest4.
}) });
tap.start() // start the test, will automtically plan tests for you (so the tap parser knows when tests exit bofore they are finished)
tap.start(); // start the test, will automtically plan tests for you (so the tap parser knows when tests exit bofore they are finished)
``` ```
For further information read the linked docs at the top of this README. For further information read the linked docs at the top of this README.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh) > MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html) > | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks) [![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

View File

@ -1,13 +1,16 @@
# tapbundle # tapbundle
tap bundled for tapbuffer tap bundled for tapbuffer
## Availabililty ## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/tapbundle) [![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/tapbundle)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/tapbundle) [![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/tapbundle)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/tapbundle) [![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/tapbundle)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/tapbundle/) [![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/tapbundle/)
## Status for master ## Status for master
[![build status](https://GitLab.com/pushrocks/tapbundle/badges/master/build.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master) [![build status](https://GitLab.com/pushrocks/tapbundle/badges/master/build.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master)
[![coverage report](https://GitLab.com/pushrocks/tapbundle/badges/master/coverage.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master) [![coverage report](https://GitLab.com/pushrocks/tapbundle/badges/master/coverage.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/tapbundle.svg)](https://www.npmjs.com/package/tapbundle) [![npm downloads per month](https://img.shields.io/npm/dm/tapbundle.svg)](https://www.npmjs.com/package/tapbundle)
@ -21,6 +24,6 @@ tap bundled for tapbuffer
For further information read the linked docs at the top of this README. For further information read the linked docs at the top of this README.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh) > MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html) > | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks) [![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

608
package-lock.json generated
View File

@ -4,227 +4,394 @@
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@airbnb/node-memwatch": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@airbnb/node-memwatch/-/node-memwatch-1.0.2.tgz",
"integrity": "sha512-2R+MEEMSTUdKwQ6NFWkyA/UNoSjL1tMldZqJbZpgXSwNMBzlNlkUWEXKu9RqTTMkDqJRfGJ2VDs8gPlPK2APDQ==",
"requires": {
"bindings": "^1.3.0",
"nan": "^2.9.2"
}
},
"@gitzone/tsrun": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@gitzone/tsrun/-/tsrun-1.0.7.tgz",
"integrity": "sha512-2ANXf65j2Cwry5sU0NrelgDhBLVsajl47mHpxy9JgWKCNx9Exavpg748FtPfbdQVqCqo3pKCmOq9eHwxcGMmeA==",
"dev": true,
"requires": {
"ts-node": "^6.1.0",
"typescript": "^2.9.1"
}
},
"@types/chai": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.4.tgz",
"integrity": "sha512-h6+VEw2Vr3ORiFCyyJmcho2zALnUq9cvdB/IO8Xs9itrJVCenC7o26A6+m7D0ihTTr65eS259H5/Ghl/VjYs6g=="
},
"@types/chai-as-promised": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.0.tgz",
"integrity": "sha512-MFiW54UOSt+f2bRw8J7LgQeIvE/9b4oGvwU7XW30S9QGAiHGnU/fmiOprsyMkdmH2rl8xSPc0/yrQw8juXU6bQ==",
"requires": {
"@types/chai": "*"
}
},
"@types/chai-string": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/@types/chai-string/-/chai-string-1.4.1.tgz",
"integrity": "sha512-aRNMs6TKgjgPlCHwDfq/YNy5VtRR2hJ4AUWByddrT0TRVVD8eX4MiHW6/iHvmQHRlVuuPZcwnTUE7b4yFt7bEA==",
"requires": {
"@types/chai": "*"
}
},
"@types/node": { "@types/node": {
"version": "8.0.33", "version": "10.5.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.33.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.0.tgz",
"integrity": "sha512-vmCdO8Bm1ExT+FWfC9sd9r4jwqM7o97gGy2WBshkkXbf/2nLAJQUrZfIhw27yVOtLUev6kSZc4cav/46KbDd8A==" "integrity": "sha512-baXPuqA7EVcBUpA5so2K26DTzk7NCWBc9xrPMu9PbUMwgusJRm9zJBPhiDmJVEcnTQ3aOxUZeuFHpd9qMYDNRg==",
"dev": true
},
"ansi-256-colors": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz",
"integrity": "sha1-kQ3lDvzHwJ49gvL4er1rcAwYgYo="
},
"array-uniq": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz",
"integrity": "sha1-X8w3OSB3VyPP1k1lxkvvU7+eum0=",
"dev": true
},
"arrify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
"integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
"dev": true
},
"assertion-error": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw=="
},
"beautycolor": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/beautycolor/-/beautycolor-1.0.11.tgz",
"integrity": "sha512-Uxl/39+2uqixPzsrV+0NOHf0sJlWmsKnRTV0oz8+bfwnHPA/E+SZuh3Upn3OXobv0W7LZg5BVoLj1nkMj7m5jA==",
"requires": {
"ansi-256-colors": "^1.1.0",
"typings-global": "^1.0.14"
}
},
"bindings": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz",
"integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw=="
},
"buffer-from": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz",
"integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==",
"dev": true
},
"chai": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz",
"integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=",
"requires": {
"assertion-error": "^1.0.1",
"check-error": "^1.0.1",
"deep-eql": "^3.0.0",
"get-func-name": "^2.0.0",
"pathval": "^1.0.0",
"type-detect": "^4.0.0"
}
},
"chai-as-promised": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz",
"integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==",
"requires": {
"check-error": "^1.0.2"
}
},
"chai-string": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.4.0.tgz",
"integrity": "sha1-NZFAwFHTak5LGl/GuRAVL0OKjUk="
},
"check-error": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
"integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII="
},
"deep-eql": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz",
"integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
"requires": {
"type-detect": "^4.0.0"
}
},
"define-properties": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz",
"integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=",
"requires": {
"foreach": "^2.0.5",
"object-keys": "^1.0.8"
}
},
"diff": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
"dev": true
}, },
"early": { "early": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/early/-/early-2.1.1.tgz", "resolved": "https://registry.npmjs.org/early/-/early-2.1.1.tgz",
"integrity": "sha1-hB4jJU6l3FTYr67ugvWrZcAO4jw=", "integrity": "sha1-hB4jJU6l3FTYr67ugvWrZcAO4jw=",
"requires": { "requires": {
"beautycolor": "1.0.7", "beautycolor": "^1.0.7",
"smartq": "1.1.1", "smartq": "^1.1.1",
"typings-global": "1.0.19" "typings-global": "^1.0.16"
}
},
"es-abstract": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz",
"integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==",
"requires": {
"es-to-primitive": "^1.1.1",
"function-bind": "^1.1.1",
"has": "^1.0.1",
"is-callable": "^1.1.3",
"is-regex": "^1.0.4"
}
},
"es-to-primitive": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz",
"integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=",
"requires": {
"is-callable": "^1.1.1",
"is-date-object": "^1.0.1",
"is-symbol": "^1.0.1"
}
},
"es6-error": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg=="
},
"foreach": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
"integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k="
},
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"get-func-name": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz",
"integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE="
},
"has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"requires": {
"function-bind": "^1.1.1"
}
},
"is-callable": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz",
"integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI="
},
"is-date-object": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz",
"integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY="
},
"is-regex": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz",
"integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=",
"requires": {
"has": "^1.0.1"
}
},
"is-symbol": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz",
"integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI="
},
"leakage": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/leakage/-/leakage-0.4.0.tgz",
"integrity": "sha512-x7gYK5n5dPkHDZWJ2Kh8Ag1hZNzUh+HtXn8Bv1aDdN6o6ONPCJ8sOfFq+kxcULJFp3lXaCjXb3iXOLmQRbBLwA==",
"requires": {
"@airbnb/node-memwatch": "^1.0.2",
"es6-error": "^4.0.2",
"left-pad": "^1.1.3",
"minimist": "^1.2.0",
"pretty-bytes": "^4.0.2"
}
},
"left-pad": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz",
"integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA=="
},
"make-error": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz",
"integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==",
"dev": true
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"requires": {
"minimist": "0.0.8"
}, },
"dependencies": { "dependencies": {
"beautycolor": { "minimist": {
"version": "1.0.7", "version": "0.0.8",
"resolved": "https://registry.npmjs.org/beautycolor/-/beautycolor-1.0.7.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-pHFXOKxMgiE3Hpy+tabMbRHsv3w=", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"requires": { "dev": true
"ansi-256-colors": "1.1.0",
"typings-global": "1.0.19"
},
"dependencies": {
"ansi-256-colors": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz",
"integrity": "sha1-kQ3lDvzHwJ49gvL4er1rcAwYgYo="
}
}
} }
} }
}, },
"leakage": { "nan": {
"version": "0.3.0", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/leakage/-/leakage-0.3.0.tgz", "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
"integrity": "sha1-FdaYq9x2u8ZDlgH08wIOd+LVDDk=", "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA=="
},
"object-keys": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz",
"integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag=="
},
"object.getownpropertydescriptors": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
"integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=",
"requires": { "requires": {
"es6-error": "4.0.2", "define-properties": "^1.1.2",
"left-pad": "1.1.3", "es-abstract": "^1.5.1"
"memwatch-next": "0.3.0", }
"minimist": "1.2.0", },
"pretty-bytes": "4.0.2" "pathval": {
}, "version": "1.1.0",
"dependencies": { "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz",
"es6-error": { "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA="
"version": "4.0.2", },
"resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.0.2.tgz", "pretty-bytes": {
"integrity": "sha1-7sXHJurO9Rt/a3PCDbbhsTsGnJg=" "version": "4.0.2",
}, "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz",
"left-pad": { "integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk="
"version": "1.1.3", },
"resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.1.3.tgz", "randomstring": {
"integrity": "sha1-YS9hwDPzqeCOk58crr7qQbbzGZo=" "version": "1.1.5",
}, "resolved": "https://registry.npmjs.org/randomstring/-/randomstring-1.1.5.tgz",
"memwatch-next": { "integrity": "sha1-bfBij3XL1ZMpMNn+OrTpVqGFGMM=",
"version": "0.3.0", "dev": true,
"resolved": "https://registry.npmjs.org/memwatch-next/-/memwatch-next-0.3.0.tgz", "requires": {
"integrity": "sha1-IREFD5qQbgqi1ypOwPAInHhyb48=", "array-uniq": "1.0.2"
"requires": {
"bindings": "1.2.1",
"nan": "2.6.2"
},
"dependencies": {
"bindings": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz",
"integrity": "sha1-FK1hE4EtLTfXLme0ystLtyZQXxE="
},
"nan": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz",
"integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U="
}
}
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"pretty-bytes": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz",
"integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk="
}
} }
}, },
"smartchai": { "smartchai": {
"version": "1.0.3", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/smartchai/-/smartchai-1.0.3.tgz", "resolved": "https://registry.npmjs.org/smartchai/-/smartchai-2.0.1.tgz",
"integrity": "sha1-3m0BC7i1rvJMtwsxpfUzToxBty8=", "integrity": "sha512-9M+R56OhAHXScxgr2vzQqxGx0XMS0QXriNZuP7hjlbVbo2FUT+l60iEzbwPt9Ga+5u2cEEjSSoZEQVqlROaddA==",
"requires": { "requires": {
"@types/chai": "3.5.2", "@types/chai": "^4.1.2",
"@types/chai-as-promised": "0.0.29", "@types/chai-as-promised": "^7.1.0",
"@types/chai-string": "1.1.30", "@types/chai-string": "^1.4.0",
"chai": "3.5.0", "chai": "^4.1.2",
"chai-as-promised": "6.0.0", "chai-as-promised": "^7.1.1",
"chai-string": "1.4.0" "chai-string": "^1.4.0"
},
"dependencies": {
"@types/chai": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-3.5.2.tgz",
"integrity": "sha1-wRzSgX06QBt7oPWkIPNcVhObHB4="
},
"@types/chai-as-promised": {
"version": "0.0.29",
"resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-0.0.29.tgz",
"integrity": "sha1-Q9UokqqZjhhaPePiR37bhXO+HXc=",
"requires": {
"@types/chai": "3.5.2",
"@types/promises-a-plus": "0.0.27"
},
"dependencies": {
"@types/promises-a-plus": {
"version": "0.0.27",
"resolved": "https://registry.npmjs.org/@types/promises-a-plus/-/promises-a-plus-0.0.27.tgz",
"integrity": "sha1-xkZRE0YUyEuPXXEUzokB02pgl4A="
}
}
},
"@types/chai-string": {
"version": "1.1.30",
"resolved": "https://registry.npmjs.org/@types/chai-string/-/chai-string-1.1.30.tgz",
"integrity": "sha1-TYdEsxpaIpX8AcmB7R4tTIoHDwo=",
"requires": {
"@types/chai": "3.5.2"
}
},
"chai": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz",
"integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=",
"requires": {
"assertion-error": "1.0.2",
"deep-eql": "0.1.3",
"type-detect": "1.0.0"
},
"dependencies": {
"assertion-error": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.2.tgz",
"integrity": "sha1-E8pRXYYgbaC6xm6DTdOX2HWBCUw="
},
"deep-eql": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz",
"integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=",
"requires": {
"type-detect": "0.1.1"
},
"dependencies": {
"type-detect": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz",
"integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI="
}
}
},
"type-detect": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz",
"integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI="
}
}
},
"chai-as-promised": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-6.0.0.tgz",
"integrity": "sha1-GgKkM6byTa+sY7nJb6FoTbGqjaY=",
"requires": {
"check-error": "1.0.2"
},
"dependencies": {
"check-error": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
"integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII="
}
}
},
"chai-string": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.4.0.tgz",
"integrity": "sha1-NZFAwFHTak5LGl/GuRAVL0OKjUk="
}
} }
}, },
"smartdelay": { "smartdelay": {
"version": "1.0.3", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/smartdelay/-/smartdelay-1.0.3.tgz", "resolved": "https://registry.npmjs.org/smartdelay/-/smartdelay-1.0.4.tgz",
"integrity": "sha1-X9RNrXcmLREHAvApPvqAwHLPtXk=", "integrity": "sha512-ab+d8ADiMMPKwrQNhoJYjmOR20VIIIxjknoEF9/PfMryic7tmvTmFrDMdcnMRohGNw/pN+4/I5dSUBdsDya7uw==",
"requires": { "requires": {
"smartq": "1.1.1", "smartq": "^1.1.1",
"typings-global": "1.0.19" "typings-global": "^1.0.16"
} }
}, },
"smartq": { "smartq": {
"version": "1.1.1", "version": "1.1.8",
"resolved": "https://registry.npmjs.org/smartq/-/smartq-1.1.1.tgz", "resolved": "https://registry.npmjs.org/smartq/-/smartq-1.1.8.tgz",
"integrity": "sha1-77NYcFJg1Brhiu9//YFfe2/hfdM=", "integrity": "sha512-FURlYW/C3bLeZjJcBVyw7bxCyQoCXiXbLCZcDUKznhXHaLu35c8m33/a2H8CA0rtb82lvzN8dRLnBZAcNMzNHQ==",
"requires": { "requires": {
"typed-promisify": "0.3.0", "util.promisify": "^1.0.0"
"typings-global": "1.0.19"
},
"dependencies": {
"typed-promisify": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/typed-promisify/-/typed-promisify-0.3.0.tgz",
"integrity": "sha1-G6CvXkRMh9gEdAbxjOSQkqEZGFM="
}
} }
}, },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"source-map-support": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz",
"integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
}
},
"ts-node": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-6.2.0.tgz",
"integrity": "sha512-ZNT+OEGfUNVMGkpIaDJJ44Zq3Yr0bkU/ugN1PHbU+/01Z7UV1fsELRiTx1KuQNvQ1A3pGh3y25iYF6jXgxV21A==",
"dev": true,
"requires": {
"arrify": "^1.0.0",
"buffer-from": "^1.1.0",
"diff": "^3.1.0",
"make-error": "^1.1.1",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"source-map-support": "^0.5.6",
"yn": "^2.0.0"
}
},
"type-detect": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
"integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g=="
},
"typescript": {
"version": "2.9.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz",
"integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==",
"dev": true
},
"typings-global": { "typings-global": {
"version": "1.0.19", "version": "1.0.19",
"resolved": "https://registry.npmjs.org/typings-global/-/typings-global-1.0.19.tgz", "resolved": "https://registry.npmjs.org/typings-global/-/typings-global-1.0.19.tgz",
"integrity": "sha1-M3anLU3h5VQb9XAiSP9kw+bqMWw=", "integrity": "sha1-M3anLU3h5VQb9XAiSP9kw+bqMWw=",
"requires": { "requires": {
"semver": "5.3.0", "semver": "^5.3.0",
"smartshell": "1.0.8" "smartshell": "^1.0.6"
}, },
"dependencies": { "dependencies": {
"semver": { "semver": {
@ -237,12 +404,12 @@
"resolved": "https://registry.npmjs.org/smartshell/-/smartshell-1.0.8.tgz", "resolved": "https://registry.npmjs.org/smartshell/-/smartshell-1.0.8.tgz",
"integrity": "sha1-FTV1bA/oBp9+baHj+ctsj3cJTkI=", "integrity": "sha1-FTV1bA/oBp9+baHj+ctsj3cJTkI=",
"requires": { "requires": {
"@types/shelljs": "0.7.2", "@types/shelljs": "^0.7.2",
"@types/which": "1.0.28", "@types/which": "^1.0.28",
"shelljs": "0.7.8", "shelljs": "^0.7.8",
"smartq": "1.1.1", "smartq": "^1.1.1",
"typings-global": "1.0.19", "typings-global": "^1.0.19",
"which": "1.2.14" "which": "^1.2.14"
}, },
"dependencies": { "dependencies": {
"@types/shelljs": { "@types/shelljs": {
@ -250,7 +417,7 @@
"resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.2.tgz", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.2.tgz",
"integrity": "sha1-wr2z/oDNej2gh1DKiYrkTFiWcfM=", "integrity": "sha1-wr2z/oDNej2gh1DKiYrkTFiWcfM=",
"requires": { "requires": {
"@types/node": "8.0.7" "@types/node": "*"
}, },
"dependencies": { "dependencies": {
"@types/node": { "@types/node": {
@ -270,9 +437,9 @@
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz",
"integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=",
"requires": { "requires": {
"glob": "7.1.2", "glob": "^7.0.0",
"interpret": "1.0.3", "interpret": "^1.0.0",
"rechoir": "0.6.2" "rechoir": "^0.6.2"
}, },
"dependencies": { "dependencies": {
"glob": { "glob": {
@ -280,12 +447,12 @@
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=",
"requires": { "requires": {
"fs.realpath": "1.0.0", "fs.realpath": "^1.0.0",
"inflight": "1.0.6", "inflight": "^1.0.4",
"inherits": "2.0.3", "inherits": "2",
"minimatch": "3.0.4", "minimatch": "^3.0.4",
"once": "1.4.0", "once": "^1.3.0",
"path-is-absolute": "1.0.1" "path-is-absolute": "^1.0.0"
}, },
"dependencies": { "dependencies": {
"fs.realpath": { "fs.realpath": {
@ -298,8 +465,8 @@
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": { "requires": {
"once": "1.4.0", "once": "^1.3.0",
"wrappy": "1.0.2" "wrappy": "1"
}, },
"dependencies": { "dependencies": {
"wrappy": { "wrappy": {
@ -319,7 +486,7 @@
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=",
"requires": { "requires": {
"brace-expansion": "1.1.8" "brace-expansion": "^1.1.7"
}, },
"dependencies": { "dependencies": {
"brace-expansion": { "brace-expansion": {
@ -327,7 +494,7 @@
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
"requires": { "requires": {
"balanced-match": "1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
}, },
"dependencies": { "dependencies": {
@ -350,7 +517,7 @@
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": { "requires": {
"wrappy": "1.0.2" "wrappy": "1"
}, },
"dependencies": { "dependencies": {
"wrappy": { "wrappy": {
@ -377,7 +544,7 @@
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
"integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
"requires": { "requires": {
"resolve": "1.3.3" "resolve": "^1.1.6"
}, },
"dependencies": { "dependencies": {
"resolve": { "resolve": {
@ -385,7 +552,7 @@
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz",
"integrity": "sha1-ZVkHw0aahoDcLeOidaj91paR8OU=", "integrity": "sha1-ZVkHw0aahoDcLeOidaj91paR8OU=",
"requires": { "requires": {
"path-parse": "1.0.5" "path-parse": "^1.0.5"
}, },
"dependencies": { "dependencies": {
"path-parse": { "path-parse": {
@ -404,7 +571,7 @@
"resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz",
"integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=",
"requires": { "requires": {
"isexe": "2.0.0" "isexe": "^2.0.0"
}, },
"dependencies": { "dependencies": {
"isexe": { "isexe": {
@ -417,6 +584,21 @@
} }
} }
} }
},
"util.promisify": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz",
"integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==",
"requires": {
"define-properties": "^1.1.2",
"object.getownpropertydescriptors": "^2.0.3"
}
},
"yn": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz",
"integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=",
"dev": true
} }
} }
} }

View File

@ -1,11 +1,13 @@
{ {
"name": "tapbundle", "name": "tapbundle",
"private": false,
"version": "2.0.0", "version": "2.0.0",
"description": "tap bundled for tapbuffer", "description": "tap bundled for tapbuffer",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
"scripts": { "scripts": {
"test": "(npmts)" "test": "(tsrun test/test.ts)",
"build": "(npmts)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -19,13 +21,14 @@
"homepage": "https://gitlab.com/pushrocks/tapbundle#README", "homepage": "https://gitlab.com/pushrocks/tapbundle#README",
"dependencies": { "dependencies": {
"early": "^2.1.1", "early": "^2.1.1",
"leakage": "^0.3.0", "leakage": "^0.4.0",
"smartchai": "^2.0.0", "smartchai": "^2.0.1",
"smartdelay": "^1.0.3", "smartdelay": "^1.0.4",
"smartq": "^1.1.1" "smartq": "^1.1.8"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^9.4.6", "@gitzone/tsrun": "^1.0.7",
"@types/node": "^10.5.0",
"randomstring": "^1.1.5" "randomstring": "^1.1.5"
} }
} }

View File

@ -1,21 +1,21 @@
import { tap, expect } from '../ts/index' import { tap, expect } from '../ts/index';
import * as randomstring from 'randomstring' import * as randomstring from 'randomstring';
let test1 = tap.test('my first test -> expect true to be true', async (tools) => { let test1 = tap.test('my first test -> expect true to be true', async tools => {
await tools.checkIterationLeak(async () => { await tools.checkIterationLeak(async () => {
let domain = randomstring.generate(1000) let domain = randomstring.generate(1000);
}) });
}) });
let outsideArray = [] let outsideArray = [];
let test2 = tap.test('should throw', async (tools) => { let test2 = tap.test('should throw', async tools => {
let err = await tools.returnError(async () => { let err = await tools.returnError(async () => {
await tools.checkIterationLeak(async () => { await tools.checkIterationLeak(async () => {
outsideArray.push(randomstring.generate(1000)) outsideArray.push(randomstring.generate(1000));
}) });
}) });
expect(err).to.be.instanceof(Error) expect(err).to.be.instanceof(Error);
}) });
tap.start() tap.start();

View File

@ -1,10 +1,10 @@
import { tap, expect } from '../dist/index' import { tap, expect } from '../dist/index';
let tapwrap = tap.wrap(async () => { let tapwrap = tap.wrap(async () => {
tap.test('should do something', async () => { tap.test('should do something', async () => {
console.log('test1') console.log('test1');
}) });
tap.start() tap.start();
}) });
tapwrap.run() tapwrap.run();

View File

@ -1,32 +1,36 @@
import { tap, expect } from '../ts/index' import { tap, expect } from '../ts/index';
let test1 = tap.test('my first test -> expect true to be true', async () => { let test1 = tap.test('my first test -> expect true to be true', async () => {
return expect(true).to.be.true return expect(true).to.be.true;
}) });
let test2 = tap.test('my second test', async (tools) => { let test2 = tap.test('my second test', async tools => {
await tools.delayFor(1000) await tools.delayFor(1000);
}) });
let test3 = tap.test('my third test -> test2 should take longer than test1 and endure at least 1000ms', async () => { let test3 = tap.test(
expect((await test1).hrtMeasurement.milliSeconds < (await test2).hrtMeasurement.milliSeconds).to.be.true 'my third test -> test2 should take longer than test1 and endure at least 1000ms',
expect((await test2).hrtMeasurement.milliSeconds > 1000).to.be.true async () => {
}) expect((await test1).hrtMeasurement.milliSeconds < (await test2).hrtMeasurement.milliSeconds).to
.be.true;
expect((await test2).hrtMeasurement.milliSeconds > 1000).to.be.true;
}
);
let test4 = tap.skip.test('my 4th test -> should fail', async (tools) => { let test4 = tap.skip.test('my 4th test -> should fail', async tools => {
tools.allowFailure() tools.allowFailure();
expect(false).to.be.true expect(false).to.be.true;
}) });
let test5 = tap.test('my 5th test -> should pass in about 500ms', async (tools) => { let test5 = tap.test('my 5th test -> should pass in about 500ms', async tools => {
tools.timeout(1000) tools.timeout(1000);
await tools.delayFor(500) await tools.delayFor(500);
}) });
let test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async (tools) => { let test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async tools => {
tools.allowFailure() tools.allowFailure();
tools.timeout(1000) tools.timeout(1000);
await tools.delayFor(2000) await tools.delayFor(2000);
}) });
tap.start() tap.start();

View File

@ -1,2 +1,2 @@
export { expect } from 'smartchai' export { expect } from 'smartchai';
export { tap } from './tapbundle.classes.tap' export { tap } from './tapbundle.classes.tap';

View File

@ -1,40 +1,39 @@
import * as plugins from './tapbundle.plugins' import * as plugins from './tapbundle.plugins';
import { TapTest, ITestFunction } from './tapbundle.classes.taptest' import { TapTest, ITestFunction } from './tapbundle.classes.taptest';
import { TapWrap, ITapWrapFunction } from './tapbundle.classes.tapwrap' import { TapWrap, ITapWrapFunction } from './tapbundle.classes.tapwrap';
export class Tap { export class Tap {
/** /**
* skip a test * skip a test
*/ */
skip = { skip = {
test: (descriptionArg: string, functionArg: ITestFunction) => { test: (descriptionArg: string, functionArg: ITestFunction) => {
console.log(`skipped test: ${descriptionArg}`) console.log(`skipped test: ${descriptionArg}`);
} }
} };
private _tapTests: TapTest[] = [] private _tapTests: TapTest[] = [];
/** /**
* Normal test function, will run one by one * Normal test function, will run one by one
* @param testDescription - A description of what the test does * @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects * @param testFunction - A Function that returns a Promise and resolves or rejects
*/ */
async test (testDescription: string, testFunction: ITestFunction) { async test(testDescription: string, testFunction: ITestFunction) {
let localTest = new TapTest({ let localTest = new TapTest({
description: testDescription, description: testDescription,
testFunction: testFunction, testFunction: testFunction,
parallel: false parallel: false
}) });
this._tapTests.push(localTest) this._tapTests.push(localTest);
return localTest return localTest;
} }
/** /**
* wraps function * wraps function
*/ */
wrap (functionArg: ITapWrapFunction) { wrap(functionArg: ITapWrapFunction) {
return new TapWrap(functionArg) return new TapWrap(functionArg);
} }
/** /**
@ -42,71 +41,70 @@ export class Tap {
* @param testDescription - A description of what the test does * @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects * @param testFunction - A Function that returns a Promise and resolves or rejects
*/ */
testParallel (testDescription: string, testFunction: ITestFunction) { testParallel(testDescription: string, testFunction: ITestFunction) {
this._tapTests.push(new TapTest({ this._tapTests.push(
description: testDescription, new TapTest({
testFunction: testFunction, description: testDescription,
parallel: true testFunction: testFunction,
})) parallel: true
})
);
} }
/** /**
* starts the test evaluation * starts the test evaluation
*/ */
async start(optionsArg?: { async start(optionsArg?: { throwOnError: boolean }) {
throwOnError: boolean let promiseArray: Promise<any>[] = [];
}) {
let promiseArray: Promise<any>[] = []
// safeguard against empty test array // safeguard against empty test array
if (this._tapTests.length === 0) { if (this._tapTests.length === 0) {
console.log('no tests specified. Ending here!') console.log('no tests specified. Ending here!');
return return;
} }
console.log(`1..${this._tapTests.length}`) console.log(`1..${this._tapTests.length}`);
for (let testKey = 0; testKey < this._tapTests.length; testKey++) { for (let testKey = 0; testKey < this._tapTests.length; testKey++) {
let currentTest = this._tapTests[testKey] let currentTest = this._tapTests[testKey];
let testPromise = currentTest.run(testKey) let testPromise = currentTest.run(testKey);
if (currentTest.parallel) { if (currentTest.parallel) {
promiseArray.push(testPromise) promiseArray.push(testPromise);
} else { } else {
await testPromise await testPromise;
} }
} }
await Promise.all(promiseArray) await Promise.all(promiseArray);
// when tests have been run and all promises are fullfilled // when tests have been run and all promises are fullfilled
let failReasons: string[] = [] let failReasons: string[] = [];
let executionNotes: string[] = [] let executionNotes: string[] = [];
// collect failed tests // collect failed tests
for (let tapTest of this._tapTests) { for (let tapTest of this._tapTests) {
if (tapTest.status !== 'success') { if (tapTest.status !== 'success') {
failReasons.push( failReasons.push(
`Test ${tapTest.testKey + 1} failed with status ${tapTest.status}:\n` `Test ${tapTest.testKey + 1} failed with status ${tapTest.status}:\n` +
+ `|| ${tapTest.description}\n` `|| ${tapTest.description}\n` +
+ `|| for more information please take a look the logs above` `|| for more information please take a look the logs above`
) );
} }
} }
// render fail Reasons // render fail Reasons
for (let failReason of failReasons) { for (let failReason of failReasons) {
console.log(failReason) console.log(failReason);
} }
if (optionsArg && optionsArg.throwOnError && failReasons.length > 0) { if (optionsArg && optionsArg.throwOnError && failReasons.length > 0) {
process.exit(1) process.exit(1);
} }
} }
/** /**
* handle errors * handle errors
*/ */
threw (err) { threw(err) {
console.log(err) console.log(err);
} }
} }
export let tap = new Tap() export let tap = new Tap();

View File

@ -1,80 +1,79 @@
import * as plugins from './tapbundle.plugins' import * as plugins from './tapbundle.plugins';
import { tapCreator } from './tapbundle.tapcreator' import { tapCreator } from './tapbundle.tapcreator';
import { TapTools } from './tapbundle.classes.taptools' import { TapTools } from './tapbundle.classes.taptools';
// imported interfaces // imported interfaces
import { HrtMeasurement } from 'early' import { HrtMeasurement } from 'early';
import { Deferred } from 'smartq' import { Deferred } from 'smartq';
// interfaces // interfaces
export type TTestStatus = 'success' | 'error' | 'pending' | 'errorAfterSuccess' | 'timeout' export type TTestStatus = 'success' | 'error' | 'pending' | 'errorAfterSuccess' | 'timeout';
export interface ITestFunction { export interface ITestFunction {
(tapTools?: TapTools): Promise<any> (tapTools?: TapTools): Promise<any>;
} }
export class TapTest { export class TapTest {
description: string description: string;
failureAllowed: boolean failureAllowed: boolean;
hrtMeasurement: HrtMeasurement hrtMeasurement: HrtMeasurement;
parallel: boolean parallel: boolean;
status: TTestStatus status: TTestStatus;
tapTools: TapTools tapTools: TapTools;
testFunction: ITestFunction testFunction: ITestFunction;
testKey: number // the testKey the position in the test qeue. Set upon calling .run() testKey: number; // the testKey the position in the test qeue. Set upon calling .run()
testDeferred: Deferred<TapTest> = plugins.smartq.defer() testDeferred: Deferred<TapTest> = plugins.smartq.defer();
testPromise: Promise<TapTest> = this.testDeferred.promise testPromise: Promise<TapTest> = this.testDeferred.promise;
/** /**
* constructor * constructor
*/ */
constructor (optionsArg: { constructor(optionsArg: { description: string; testFunction: ITestFunction; parallel: boolean }) {
description: string, this.description = optionsArg.description;
testFunction: ITestFunction, this.hrtMeasurement = new HrtMeasurement();
parallel: boolean this.parallel = optionsArg.parallel;
}) { this.status = 'pending';
this.description = optionsArg.description this.tapTools = new TapTools(this);
this.hrtMeasurement = new HrtMeasurement() this.testFunction = optionsArg.testFunction;
this.parallel = optionsArg.parallel
this.status = 'pending'
this.tapTools = new TapTools(this)
this.testFunction = optionsArg.testFunction
} }
/** /**
* run the test * run the test
*/ */
async run (testKeyArg: number) { async run(testKeyArg: number) {
this.hrtMeasurement.start() this.hrtMeasurement.start();
this.testKey = testKeyArg this.testKey = testKeyArg;
let testNumber = testKeyArg + 1 let testNumber = testKeyArg + 1;
try { try {
await this.testFunction(this.tapTools) await this.testFunction(this.tapTools);
if (this.status === 'timeout') { if (this.status === 'timeout') {
throw new Error ('Test succeeded, but timed out...') throw new Error('Test succeeded, but timed out...');
} }
this.hrtMeasurement.stop() this.hrtMeasurement.stop();
console.log(`ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`) console.log(
this.status = 'success' `ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`
this.testDeferred.resolve(this) );
this.status = 'success';
this.testDeferred.resolve(this);
} catch (err) { } catch (err) {
this.hrtMeasurement.stop() this.hrtMeasurement.stop();
console.log(`not ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`) console.log(
this.testDeferred.resolve(this) `not ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`
);
this.testDeferred.resolve(this);
// if the test has already succeeded before // if the test has already succeeded before
if (this.status === 'success') { if (this.status === 'success') {
this.status = 'errorAfterSuccess' this.status = 'errorAfterSuccess';
console.log('!!! ALERT !!!: weird behaviour, since test has been already successfull') console.log('!!! ALERT !!!: weird behaviour, since test has been already successfull');
} else { } else {
this.status = 'error' this.status = 'error';
} }
// if the test is allowed to fail // if the test is allowed to fail
if (this.failureAllowed) { if (this.failureAllowed) {
console.log(`please note: failure allowed!`) console.log(`please note: failure allowed!`);
} }
console.log(err) console.log(err);
} }
} }
} }

View File

@ -1,59 +1,58 @@
import * as plugins from './tapbundle.plugins' import * as plugins from './tapbundle.plugins';
import { TapTest } from './tapbundle.classes.taptest' import { TapTest } from './tapbundle.classes.taptest';
export interface IPromiseFunc { export interface IPromiseFunc {
(): Promise<any> (): Promise<any>;
} }
export class TapTools { export class TapTools {
/** /**
* the referenced TapTest * the referenced TapTest
*/ */
private _tapTest: TapTest private _tapTest: TapTest;
constructor (TapTestArg) { constructor(TapTestArg) {
this._tapTest = TapTestArg this._tapTest = TapTestArg;
} }
/** /**
* allow failure * allow failure
*/ */
allowFailure () { allowFailure() {
this._tapTest.failureAllowed = true this._tapTest.failureAllowed = true;
} }
/** /**
* async/await delay method * async/await delay method
*/ */
async delayFor (timeMilliArg) { async delayFor(timeMilliArg) {
await plugins.smartdelay.delayFor(timeMilliArg) await plugins.smartdelay.delayFor(timeMilliArg);
} }
async delayForRandom (timeMilliMinArg, timeMilliMaxArg) { async delayForRandom(timeMilliMinArg, timeMilliMaxArg) {
await plugins.smartdelay.delayForRandom(timeMilliMinArg, timeMilliMaxArg) await plugins.smartdelay.delayForRandom(timeMilliMinArg, timeMilliMaxArg);
} }
async timeout (timeMilliArg: number) { async timeout(timeMilliArg: number) {
let timeout = new plugins.smartdelay.Timeout(timeMilliArg) let timeout = new plugins.smartdelay.Timeout(timeMilliArg);
timeout.makeUnrefed() timeout.makeUnrefed();
await timeout.promise await timeout.promise;
if (this._tapTest.status === 'pending') { if (this._tapTest.status === 'pending') {
this._tapTest.status = 'timeout' this._tapTest.status = 'timeout';
} }
} }
async checkIterationLeak (iterationfuncArg: IPromiseFunc) { async checkIterationLeak(iterationfuncArg: IPromiseFunc) {
await plugins.leakage.iterate.async(iterationfuncArg) await plugins.leakage.iterate.async(iterationfuncArg);
} }
async returnError (throwingFuncArg: IPromiseFunc) { async returnError(throwingFuncArg: IPromiseFunc) {
let funcErr: Error let funcErr: Error;
try { try {
await throwingFuncArg() await throwingFuncArg();
} catch (err) { } catch (err) {
funcErr = err funcErr = err;
} }
return funcErr return funcErr;
} }
} }

View File

@ -1,24 +1,24 @@
import * as plugins from './tapbundle.plugins' import * as plugins from './tapbundle.plugins';
export interface ITapWrapFunction { export interface ITapWrapFunction {
(): Promise<any> (): Promise<any>;
} }
export class TapWrap { export class TapWrap {
wrapFunction: ITapWrapFunction wrapFunction: ITapWrapFunction;
/** /**
* the constructor * the constructor
*/ */
constructor (wrapFunctionArg: ITapWrapFunction) { constructor(wrapFunctionArg: ITapWrapFunction) {
// nothing here // nothing here
this.wrapFunction = wrapFunctionArg this.wrapFunction = wrapFunctionArg;
} }
/** /**
* run the wrapFunction * run the wrapFunction
*/ */
async run () { async run() {
await this.wrapFunction() await this.wrapFunction();
} }
} }

View File

@ -1,11 +1,6 @@
import * as early from 'early' import * as early from 'early';
import * as leakage from 'leakage' import * as leakage from 'leakage';
import * as smartdelay from 'smartdelay' import * as smartdelay from 'smartdelay';
import * as smartq from 'smartq' import * as smartq from 'smartq';
export { export { early, smartdelay, smartq, leakage };
early,
smartdelay,
smartq,
leakage
}

View File

@ -1,7 +1,7 @@
import * as plugins from './tapbundle.plugins' import * as plugins from './tapbundle.plugins';
export class TapCreator { export class TapCreator {
// TODO: // TODO:
} }
export let tapCreator = new TapCreator() export let tapCreator = new TapCreator();

244
yarn.lock
View File

@ -1,244 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/chai-as-promised@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.0.tgz#010b04cde78eacfb6e72bfddb3e58fe23c2e78b9"
dependencies:
"@types/chai" "*"
"@types/chai-string@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@types/chai-string/-/chai-string-1.4.0.tgz#c8b78deb9ae53e86c05a446c256138faeaff53c1"
dependencies:
"@types/chai" "*"
"@types/chai@*", "@types/chai@^4.1.2":
version "4.1.2"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.2.tgz#f1af664769cfb50af805431c407425ed619daa21"
"@types/node@^9.4.6":
version "9.4.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.6.tgz#d8176d864ee48753d053783e4e463aec86b8d82e"
ansi-256-colors@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz#910de50efcc7c09e3d82f2f87abd6b700c18818a"
array-uniq@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.2.tgz#5fcc373920775723cfd64d65c64bef53bf9eba6d"
assertion-error@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b"
beautycolor@^1.0.7:
version "1.0.11"
resolved "https://registry.yarnpkg.com/beautycolor/-/beautycolor-1.0.11.tgz#71c5568d5a7ed5c144d3a54f753ad1b08862aea5"
dependencies:
ansi-256-colors "^1.1.0"
typings-global "^1.0.14"
bindings@^1.2.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7"
chai-as-promised@^7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0"
dependencies:
check-error "^1.0.2"
chai-string@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/chai-string/-/chai-string-1.4.0.tgz#359140c051d36a4e4b1a5fc6b910152f438a8d49"
chai@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c"
dependencies:
assertion-error "^1.0.1"
check-error "^1.0.1"
deep-eql "^3.0.0"
get-func-name "^2.0.0"
pathval "^1.0.0"
type-detect "^4.0.0"
check-error@^1.0.1, check-error@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
deep-eql@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df"
dependencies:
type-detect "^4.0.0"
define-properties@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
dependencies:
foreach "^2.0.5"
object-keys "^1.0.8"
early@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/early/-/early-2.1.1.tgz#841e23254ea5dc54d8afaeee82f5ab65c00ee23c"
dependencies:
beautycolor "^1.0.7"
smartq "^1.1.1"
typings-global "^1.0.16"
es-abstract@^1.5.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864"
dependencies:
es-to-primitive "^1.1.1"
function-bind "^1.1.1"
has "^1.0.1"
is-callable "^1.1.3"
is-regex "^1.0.4"
es-to-primitive@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
dependencies:
is-callable "^1.1.1"
is-date-object "^1.0.1"
is-symbol "^1.0.1"
es6-error@^4.0.2:
version "4.1.1"
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d"
foreach@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
function-bind@^1.0.2, function-bind@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
get-func-name@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41"
has@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
dependencies:
function-bind "^1.0.2"
is-callable@^1.1.1, is-callable@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
is-date-object@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
is-regex@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
dependencies:
has "^1.0.1"
is-symbol@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
leakage@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39"
dependencies:
es6-error "^4.0.2"
left-pad "^1.1.3"
memwatch-next "^0.3.0"
minimist "^1.2.0"
pretty-bytes "^4.0.2"
left-pad@^1.1.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee"
memwatch-next@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/memwatch-next/-/memwatch-next-0.3.0.tgz#2111050f9a906e0aa2d72a4ec0f0089c78726f8f"
dependencies:
bindings "^1.2.1"
nan "^2.3.2"
minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
nan@^2.3.2:
version "2.9.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.9.2.tgz#f564d75f5f8f36a6d9456cca7a6c4fe488ab7866"
object-keys@^1.0.8:
version "1.0.11"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
object.getownpropertydescriptors@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
dependencies:
define-properties "^1.1.2"
es-abstract "^1.5.1"
pathval@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0"
pretty-bytes@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
randomstring@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/randomstring/-/randomstring-1.1.5.tgz#6df0628f75cbd5932930d9fe3ab4e956a18518c3"
dependencies:
array-uniq "1.0.2"
smartchai@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/smartchai/-/smartchai-2.0.0.tgz#8263e567fda6670315722992d425bbe9f31bd3e1"
dependencies:
"@types/chai" "^4.1.2"
"@types/chai-as-promised" "^7.1.0"
"@types/chai-string" "^1.4.0"
chai "^4.1.2"
chai-as-promised "^7.1.1"
chai-string "^1.4.0"
smartdelay@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/smartdelay/-/smartdelay-1.0.4.tgz#791c1a4ee6770494064c10b1d2d2b8e6f3105b82"
dependencies:
smartq "^1.1.1"
typings-global "^1.0.16"
smartq@^1.1.1:
version "1.1.6"
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.6.tgz#0c1ff4336d95e95b4f1fdd8ccd7e2c5a323b8412"
dependencies:
typings-global "^1.0.19"
util.promisify "^1.0.0"
type-detect@^4.0.0:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19:
version "1.0.28"
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.28.tgz#e28cc965476564cbc00e438739e0aa0735d323d4"
util.promisify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
dependencies:
define-properties "^1.1.2"
object.getownpropertydescriptors "^2.0.3"