@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/ts-common",
3
- "version": "0.201.13",
3
+ "version": "0.201.14",
4
4
  "description": "js and ts infra",
5
5
  "keywords": [
6
6
  "TacB0sS",
@@ -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 const testSuiteTester: <Input, ExpectedResult>(testSuit: TestSuite<Input, ExpectedResult>) => void;
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
- const testSuiteTester = (testSuit) => {
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
- it(testCase.description, () => testSuit.processor(testCase));
32
+ (testcases.length > 0 ? testcases : testSuit.testcases).forEach(testCase => {
33
+ testSuite_RunTest(testSuit, testCase);
30
34
  });
31
35
  });
32
36
  };
@@ -1,5 +1,5 @@
1
1
  import { TS_Object } from './types';
2
- export declare function deepClone<T>(obj: T): T;
2
+ export declare function deepClone<T>(obj: T | Readonly<T>): T;
3
3
  export declare function _keys<T extends {
4
4
  [k: string]: any;
5
5
  }, K extends keyof T>(instance: T): K[];