@nu-art/ts-common 0.201.13 → 0.201.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/testing/consts.d.ts +3 -2
- package/testing/consts.js +8 -4
- package/utils/object-tools.d.ts +1 -1
package/package.json
CHANGED
package/testing/consts.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="chai" />
|
|
2
2
|
/// <reference types="chai-as-promised" />
|
|
3
|
-
import { TestSuite } from './types';
|
|
3
|
+
import { TestModel, TestSuite } from './types';
|
|
4
4
|
import { ModuleManager } from '../core/module-manager';
|
|
5
5
|
export declare class ModuleManagerTester extends ModuleManager {
|
|
6
6
|
constructor();
|
|
7
7
|
}
|
|
8
|
-
export declare
|
|
8
|
+
export declare function testSuite_RunTest<Input, ExpectedResult>(testSuit: TestSuite<Input, ExpectedResult>, testCase: TestModel<Input, ExpectedResult>): void;
|
|
9
|
+
export declare const testSuiteTester: <Input, ExpectedResult>(testSuit: TestSuite<Input, ExpectedResult>, ...testcases: TestModel<Input, ExpectedResult>[]) => void;
|
|
9
10
|
export declare const expectFailAsync: (action: () => Promise<void>) => Promise<Chai.Assertion>;
|
package/testing/consts.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.expectFailAsync = exports.testSuiteTester = exports.ModuleManagerTester = void 0;
|
|
12
|
+
exports.expectFailAsync = exports.testSuiteTester = exports.testSuite_RunTest = exports.ModuleManagerTester = void 0;
|
|
13
13
|
const chai_1 = require("chai");
|
|
14
14
|
const module_manager_1 = require("../core/module-manager");
|
|
15
15
|
const tools_1 = require("../utils/tools");
|
|
@@ -19,14 +19,18 @@ class ModuleManagerTester extends module_manager_1.ModuleManager {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.ModuleManagerTester = ModuleManagerTester;
|
|
22
|
-
|
|
22
|
+
function testSuite_RunTest(testSuit, testCase) {
|
|
23
|
+
it(testCase.description, () => testSuit.processor(testCase));
|
|
24
|
+
}
|
|
25
|
+
exports.testSuite_RunTest = testSuite_RunTest;
|
|
26
|
+
const testSuiteTester = (testSuit, ...testcases) => {
|
|
23
27
|
describe(testSuit.label, () => {
|
|
24
28
|
//Run pre-process
|
|
25
29
|
if (testSuit.preProcessor) {
|
|
26
30
|
it(`${testSuit.label} - Preprocessing`, testSuit.preProcessor);
|
|
27
31
|
}
|
|
28
|
-
testSuit.testcases.forEach(testCase => {
|
|
29
|
-
|
|
32
|
+
(testcases.length > 0 ? testcases : testSuit.testcases).forEach(testCase => {
|
|
33
|
+
testSuite_RunTest(testSuit, testCase);
|
|
30
34
|
});
|
|
31
35
|
});
|
|
32
36
|
};
|
package/utils/object-tools.d.ts
CHANGED