implemet errorAfterSuccess
This commit is contained in:
parent
64fc6e636a
commit
e640059715
3
dist/tapbundle.plugins.d.ts
vendored
3
dist/tapbundle.plugins.d.ts
vendored
@ -1,3 +1,4 @@
|
|||||||
import 'typings-global';
|
import 'typings-global';
|
||||||
import * as smartq from 'smartq';
|
import * as smartq from 'smartq';
|
||||||
export { smartq };
|
import * as leakage from 'leakage';
|
||||||
|
export { smartq, leakage };
|
||||||
|
4
dist/tapbundle.plugins.js
vendored
4
dist/tapbundle.plugins.js
vendored
@ -3,4 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
require("typings-global");
|
require("typings-global");
|
||||||
const smartq = require("smartq");
|
const smartq = require("smartq");
|
||||||
exports.smartq = smartq;
|
exports.smartq = smartq;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90YXBidW5kbGUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2QixpQ0FBZ0M7QUFHOUIsd0JBQU0ifQ==
|
const leakage = require("leakage");
|
||||||
|
exports.leakage = leakage;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90YXBidW5kbGUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2QixpQ0FBZ0M7QUFJOUIsd0JBQU07QUFIUixtQ0FBa0M7QUFJaEMsMEJBQU8ifQ==
|
18
dist/tapbundle.tap.d.ts
vendored
18
dist/tapbundle.tap.d.ts
vendored
@ -1,4 +1,4 @@
|
|||||||
export declare type TTestStatus = 'success' | 'error' | 'pending';
|
export declare type TTestStatus = 'success' | 'error' | 'pending' | 'errorAfterSuccess';
|
||||||
export interface ITestFunction {
|
export interface ITestFunction {
|
||||||
(): Promise<any>;
|
(): Promise<any>;
|
||||||
}
|
}
|
||||||
@ -23,8 +23,24 @@ export declare class TapTest {
|
|||||||
}
|
}
|
||||||
export declare class Tap {
|
export declare class Tap {
|
||||||
private _tests;
|
private _tests;
|
||||||
|
/**
|
||||||
|
* 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<void>;
|
test(testDescription: string, testFunction: ITestFunction): Promise<void>;
|
||||||
|
/**
|
||||||
|
* 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;
|
testParallel(testDescription: string, testFunction: ITestFunction): void;
|
||||||
|
/**
|
||||||
|
* tests leakage
|
||||||
|
* @param testDescription - A description of what the test does
|
||||||
|
* @param testFunction - A Function that returns a Promise and resolves or rejects
|
||||||
|
*/
|
||||||
|
testLeakage(testDescription: string, testFunction: ITestFunction): void;
|
||||||
/**
|
/**
|
||||||
* starts the test evaluation
|
* starts the test evaluation
|
||||||
*/
|
*/
|
||||||
|
27
dist/tapbundle.tap.js
vendored
27
dist/tapbundle.tap.js
vendored
@ -25,9 +25,15 @@ class TapTest {
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
yield this.testFunction();
|
yield this.testFunction();
|
||||||
console.log(`ok ${testKeyArg + 1} - ${this.description}`);
|
console.log(`ok ${testKeyArg + 1} - ${this.description} # time=20.040ms`);
|
||||||
|
this.status = 'success';
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
console.log(`not ok ${testKeyArg + 1} - ${this.description} # time=20.040ms`);
|
||||||
|
if (this.status === 'success') {
|
||||||
|
this.status = 'errorAfterSuccess';
|
||||||
|
console.log('!!! ALERT !!!: weird behaviour, since test has been already successfull');
|
||||||
|
}
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -38,6 +44,11 @@ class Tap {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this._tests = [];
|
this._tests = [];
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 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) {
|
test(testDescription, testFunction) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
this._tests.push(new TapTest({
|
this._tests.push(new TapTest({
|
||||||
@ -47,6 +58,11 @@ class Tap {
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 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) {
|
testParallel(testDescription, testFunction) {
|
||||||
this._tests.push(new TapTest({
|
this._tests.push(new TapTest({
|
||||||
description: testDescription,
|
description: testDescription,
|
||||||
@ -54,6 +70,13 @@ class Tap {
|
|||||||
parallel: true
|
parallel: true
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* tests leakage
|
||||||
|
* @param testDescription - A description of what the test does
|
||||||
|
* @param testFunction - A Function that returns a Promise and resolves or rejects
|
||||||
|
*/
|
||||||
|
testLeakage(testDescription, testFunction) {
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* starts the test evaluation
|
* starts the test evaluation
|
||||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QU8sQ0FBQyxDQUFBO2dCQUN0QyxJQUFJLFdBQVcsR0FBRyxXQUFXLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFBO2dCQUMxQyxFQUFFLENBQUMsQ0FBQyxXQUFXLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQztvQkFDekIsWUFBWSxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQTtnQkFDaEMsQ0FBQztnQkFBQyxJQUFJLENBQUMsQ0FBQztvQkFDTixNQUFNLFdBQVcsQ0FBQTtnQkFDbkIsQ0FBQztZQUNILENBQUM7WUFDRCxNQUFNLE9BQU8sQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDLENBQUE7UUFDakMsQ0FBQztLQUFBO0lBRUQ7O09BRUc7SUFDSCxLQUFLLENBQUUsR0FBRztRQUNSLE9BQU8sQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUE7SUFDbEIsQ0FBQztDQUNGO0FBckVELGtCQXFFQztBQUVVLFFBQUEsR0FBRyxHQUFHLElBQUksR0FBRyxFQUFFLENBQUEifQ==
|
3
dist/tapbundle.tapcreator.d.ts
vendored
Normal file
3
dist/tapbundle.tapcreator.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export declare class TapCreator {
|
||||||
|
}
|
||||||
|
export declare let tapCreator: TapCreator;
|
7
dist/tapbundle.tapcreator.js
vendored
Normal file
7
dist/tapbundle.tapcreator.js
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
class TapCreator {
|
||||||
|
}
|
||||||
|
exports.TapCreator = TapCreator;
|
||||||
|
exports.tapCreator = new TapCreator();
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLnRhcGNyZWF0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90YXBidW5kbGUudGFwY3JlYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBO0NBRUM7QUFGRCxnQ0FFQztBQUVVLFFBQUEsVUFBVSxHQUFHLElBQUksVUFBVSxFQUFFLENBQUEifQ==
|
@ -18,6 +18,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/tapbundle#README",
|
"homepage": "https://gitlab.com/pushrocks/tapbundle#README",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"leakage": "^0.2.0",
|
||||||
"smartchai": "^1.0.3",
|
"smartchai": "^1.0.3",
|
||||||
"smartq": "^1.1.1",
|
"smartq": "^1.1.1",
|
||||||
"typings-global": "^1.0.16"
|
"typings-global": "^1.0.16"
|
||||||
|
@ -6,4 +6,4 @@ import { tap } from './tapbundle.tap'
|
|||||||
export {
|
export {
|
||||||
tap,
|
tap,
|
||||||
expect
|
expect
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import 'typings-global'
|
import 'typings-global'
|
||||||
import * as smartq from 'smartq'
|
import * as smartq from 'smartq'
|
||||||
|
import * as leakage from 'leakage'
|
||||||
|
|
||||||
export {
|
export {
|
||||||
smartq
|
smartq,
|
||||||
|
leakage
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import * as plugins from './tapbundle.plugins'
|
import * as plugins from './tapbundle.plugins'
|
||||||
|
|
||||||
|
import { tapCreator } from './tapbundle.tapcreator'
|
||||||
|
|
||||||
// interfaces
|
// interfaces
|
||||||
export type TTestStatus = 'success' | 'error' | 'pending'
|
export type TTestStatus = 'success' | 'error' | 'pending' | 'errorAfterSuccess'
|
||||||
|
|
||||||
export interface ITestFunction {
|
export interface ITestFunction {
|
||||||
(): Promise<any>
|
(): Promise<any>
|
||||||
@ -35,8 +37,14 @@ export class TapTest {
|
|||||||
async run (testKeyArg: number) {
|
async run (testKeyArg: number) {
|
||||||
try {
|
try {
|
||||||
await this.testFunction()
|
await this.testFunction()
|
||||||
console.log(`ok ${testKeyArg + 1} - ${this.description}`)
|
console.log(`ok ${testKeyArg + 1} - ${this.description} # time=20.040ms`)
|
||||||
|
this.status = 'success'
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
console.log(`not ok ${testKeyArg + 1} - ${this.description} # time=20.040ms`)
|
||||||
|
if (this.status === 'success') {
|
||||||
|
this.status = 'errorAfterSuccess'
|
||||||
|
console.log('!!! ALERT !!!: weird behaviour, since test has been already successfull')
|
||||||
|
}
|
||||||
console.log(err)
|
console.log(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -45,6 +53,11 @@ export class TapTest {
|
|||||||
export class Tap {
|
export class Tap {
|
||||||
private _tests: TapTest[] = []
|
private _tests: TapTest[] = []
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
async test (testDescription: string, testFunction: ITestFunction) {
|
async test (testDescription: string, testFunction: ITestFunction) {
|
||||||
this._tests.push(new TapTest({
|
this._tests.push(new TapTest({
|
||||||
description: testDescription,
|
description: testDescription,
|
||||||
@ -53,6 +66,11 @@ export class Tap {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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) {
|
testParallel (testDescription: string, testFunction: ITestFunction) {
|
||||||
this._tests.push(new TapTest({
|
this._tests.push(new TapTest({
|
||||||
description: testDescription,
|
description: testDescription,
|
||||||
@ -61,6 +79,15 @@ export class Tap {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tests leakage
|
||||||
|
* @param testDescription - A description of what the test does
|
||||||
|
* @param testFunction - A Function that returns a Promise and resolves or rejects
|
||||||
|
*/
|
||||||
|
testLeakage (testDescription: string, testFunction: ITestFunction) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* starts the test evaluation
|
* starts the test evaluation
|
||||||
*/
|
*/
|
||||||
|
7
ts/tapbundle.tapcreator.ts
Normal file
7
ts/tapbundle.tapcreator.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import * as plugins from './tapbundle.plugins'
|
||||||
|
|
||||||
|
export class TapCreator {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export let tapCreator = new TapCreator()
|
36
yarn.lock
36
yarn.lock
@ -31,6 +31,10 @@ balanced-match@^0.4.1:
|
|||||||
version "0.4.2"
|
version "0.4.2"
|
||||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
|
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
|
||||||
|
|
||||||
|
bindings@^1.2.1:
|
||||||
|
version "1.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11"
|
||||||
|
|
||||||
brace-expansion@^1.0.0:
|
brace-expansion@^1.0.0:
|
||||||
version "1.1.6"
|
version "1.1.6"
|
||||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9"
|
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9"
|
||||||
@ -100,12 +104,40 @@ interpret@^1.0.0:
|
|||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c"
|
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c"
|
||||||
|
|
||||||
|
leakage@^0.2.0:
|
||||||
|
version "0.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.2.0.tgz#9e7a8cc1d241d8c8427e348769e192e172fd8733"
|
||||||
|
dependencies:
|
||||||
|
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.1.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a"
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
minimatch@^3.0.2:
|
minimatch@^3.0.2:
|
||||||
version "3.0.3"
|
version "3.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
|
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
|
||||||
dependencies:
|
dependencies:
|
||||||
brace-expansion "^1.0.0"
|
brace-expansion "^1.0.0"
|
||||||
|
|
||||||
|
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.6.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45"
|
||||||
|
|
||||||
once@^1.3.0:
|
once@^1.3.0:
|
||||||
version "1.4.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||||
@ -120,6 +152,10 @@ path-parse@^1.0.5:
|
|||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
|
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
|
||||||
|
|
||||||
|
pretty-bytes@^4.0.2:
|
||||||
|
version "4.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
|
||||||
|
|
||||||
rechoir@^0.6.2:
|
rechoir@^0.6.2:
|
||||||
version "0.6.2"
|
version "0.6.2"
|
||||||
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
|
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
|
||||||
|
Loading…
Reference in New Issue
Block a user