|
| 1 | +// Class. |
| 2 | +import { Testing, TestingIt } from "../../lib"; |
1 | 3 | import { TestingToBeArrayOf } from "../../lib/testing"; |
| 4 | +// Execute. |
| 5 | +import { ExecuteSpec } from "../execute"; |
2 | 6 |
|
| 7 | +const execute = true; |
| 8 | +const executeDescribe = true; |
| 9 | +const executeIt = true; |
3 | 10 |
|
4 | | -const t = new TestingToBeArrayOf( |
5 | | - true, |
6 | | - true, |
7 | | - {}, |
8 | | - false |
9 | | -); |
| 11 | +if (execute) { |
| 12 | + const t = new Testing( |
| 13 | + executeDescribe, |
| 14 | + executeIt, |
| 15 | + ); |
10 | 16 |
|
11 | | -t.toBeArrayOfBigInt([BigInt(1)]); |
| 17 | + const testingIt = new TestingIt(false); |
| 18 | + const test4 = new Testing( |
| 19 | + executeDescribe, |
| 20 | + executeIt, |
| 21 | + undefined, |
| 22 | + true, |
| 23 | + undefined, |
| 24 | + testingIt |
| 25 | + ); |
12 | 26 |
|
| 27 | + const test1 = new TestingToBeArrayOf(); |
| 28 | + const test2 = new TestingToBeArrayOf(false, false, {it: [4, 2]}, true); |
| 29 | + const test3 = new TestingToBeArrayOf(false, false, undefined, true, undefined, testingIt); |
| 30 | + |
| 31 | + test1.describe(`TestingToBeArrayOf true`, () => { |
| 32 | + test1 |
| 33 | + .toBeArrayOfBigInt([BigInt(37), BigInt(27)]) |
| 34 | + .toBeArrayOfDate([new Date(), new Date()]) |
| 35 | + .toBeArrayOfDefined(['37', '47']) |
| 36 | + .toBeArrayOfFalse([false, false]) |
| 37 | + .toBeArrayOfNull([null, null]) |
| 38 | + .toBeArrayOfRegExp([new RegExp('b'), new RegExp('a')]) |
| 39 | + .toBeArrayOfString(['a', 'b']) |
| 40 | + .toBeArrayOfSymbol([Symbol('a'), Symbol('b')]) |
| 41 | + .toBeArrayOfTrue([true, true, true, true]) |
| 42 | + .toBeArrayOfUndefined([undefined, undefined, undefined, undefined]) |
| 43 | + }); |
| 44 | + test2.describe(`TestingToBeArrayOf false`, () => { |
| 45 | + test2 |
| 46 | + .toBeArrayOfDefined(['37', '47']) |
| 47 | + .toBeArrayOfNull([null, null]) |
| 48 | + .toBeArrayOfSymbol([Symbol('a'), Symbol('b')]) |
| 49 | + .toBeArrayOfUndefined([undefined, undefined, undefined, undefined]) |
| 50 | + }); |
| 51 | + // Uncomment to check `testingIt`. |
| 52 | + // test4.describe(`TestingToBeArrayOf testingIt`, () => { |
| 53 | + // test3 |
| 54 | + // .toBeArrayOfDefined(['37', '47']) |
| 55 | + // .toBeArrayOfNull([null, null]) |
| 56 | + // .toBeArrayOfSymbol([Symbol('a'), Symbol('b')]) |
| 57 | + // .toBeArrayOfUndefined([undefined, undefined, undefined, undefined]) |
| 58 | + // }); |
| 59 | +} |
0 commit comments