@xylabs/jest-helpers 5.0.79 → 5.0.81
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/README.md +0 -124
- package/dist/neutral/index.d.ts +1 -4
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +0 -79
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +3 -11
- package/dist/neutral/describeIf.d.ts +0 -7
- package/dist/neutral/describeIf.d.ts.map +0 -1
- package/dist/neutral/itIf.d.ts +0 -7
- package/dist/neutral/itIf.d.ts.map +0 -1
- package/dist/neutral/tags/config.d.ts +0 -4
- package/dist/neutral/tags/config.d.ts.map +0 -1
- package/dist/neutral/tags/filter.d.ts +0 -2
- package/dist/neutral/tags/filter.d.ts.map +0 -1
- package/dist/neutral/tags/index.d.ts +0 -2
- package/dist/neutral/tags/index.d.ts.map +0 -1
- package/dist/neutral/tags/regexps.d.ts +0 -6
- package/dist/neutral/tags/regexps.d.ts.map +0 -1
- package/dist/neutral/testIf.d.ts +0 -7
- package/dist/neutral/testIf.d.ts.map +0 -1
- package/src/describeIf.ts +0 -7
- package/src/index.ts +0 -4
- package/src/itIf.ts +0 -7
- package/src/tags/config.ts +0 -5
- package/src/tags/filter.ts +0 -50
- package/src/tags/index.ts +0 -33
- package/src/tags/regexps.ts +0 -9
- package/src/testIf.ts +0 -7
package/README.md
CHANGED
|
@@ -21,130 +21,6 @@ Base functionality used throughout XY Labs TypeScript/JavaScript libraries
|
|
|
21
21
|
|
|
22
22
|
***
|
|
23
23
|
|
|
24
|
-
## Functions
|
|
25
|
-
|
|
26
|
-
- [describeIf](#functions/describeIf)
|
|
27
|
-
- [itIf](#functions/itIf)
|
|
28
|
-
- [tags](#functions/tags)
|
|
29
|
-
- [testIf](#functions/testIf)
|
|
30
|
-
|
|
31
|
-
### functions
|
|
32
|
-
|
|
33
|
-
### <a id="describeIf"></a>describeIf
|
|
34
|
-
|
|
35
|
-
[**@xylabs/jest-helpers**](#../README)
|
|
36
|
-
|
|
37
|
-
***
|
|
38
|
-
|
|
39
|
-
```ts
|
|
40
|
-
function describeIf<T>(expr?): any;
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Conditionally runs or skips the describe
|
|
44
|
-
|
|
45
|
-
## Type Parameters
|
|
46
|
-
|
|
47
|
-
### T
|
|
48
|
-
|
|
49
|
-
`T`
|
|
50
|
-
|
|
51
|
-
## Parameters
|
|
52
|
-
|
|
53
|
-
### expr?
|
|
54
|
-
|
|
55
|
-
The condition to evaluate
|
|
56
|
-
|
|
57
|
-
`null` | `T`
|
|
58
|
-
|
|
59
|
-
## Returns
|
|
60
|
-
|
|
61
|
-
`any`
|
|
62
|
-
|
|
63
|
-
If the condition is true, describe, otherwise skips
|
|
64
|
-
|
|
65
|
-
### <a id="itIf"></a>itIf
|
|
66
|
-
|
|
67
|
-
[**@xylabs/jest-helpers**](#../README)
|
|
68
|
-
|
|
69
|
-
***
|
|
70
|
-
|
|
71
|
-
```ts
|
|
72
|
-
function itIf<T>(expr?): any;
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Conditionally runs or skips the it
|
|
76
|
-
|
|
77
|
-
## Type Parameters
|
|
78
|
-
|
|
79
|
-
### T
|
|
80
|
-
|
|
81
|
-
`T`
|
|
82
|
-
|
|
83
|
-
## Parameters
|
|
84
|
-
|
|
85
|
-
### expr?
|
|
86
|
-
|
|
87
|
-
The condition to evaluate
|
|
88
|
-
|
|
89
|
-
`null` | `T`
|
|
90
|
-
|
|
91
|
-
## Returns
|
|
92
|
-
|
|
93
|
-
`any`
|
|
94
|
-
|
|
95
|
-
If the condition is true, it, otherwise skips
|
|
96
|
-
|
|
97
|
-
### <a id="tags"></a>tags
|
|
98
|
-
|
|
99
|
-
[**@xylabs/jest-helpers**](#../README)
|
|
100
|
-
|
|
101
|
-
***
|
|
102
|
-
|
|
103
|
-
```ts
|
|
104
|
-
function tags(...tagLabels): Record<string, any>;
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Parameters
|
|
108
|
-
|
|
109
|
-
### tagLabels
|
|
110
|
-
|
|
111
|
-
...`string`[]
|
|
112
|
-
|
|
113
|
-
## Returns
|
|
114
|
-
|
|
115
|
-
`Record`\<`string`, `any`\>
|
|
116
|
-
|
|
117
|
-
### <a id="testIf"></a>testIf
|
|
118
|
-
|
|
119
|
-
[**@xylabs/jest-helpers**](#../README)
|
|
120
|
-
|
|
121
|
-
***
|
|
122
|
-
|
|
123
|
-
```ts
|
|
124
|
-
function testIf<T>(expr?): any;
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Conditionally runs or skips the test
|
|
128
|
-
|
|
129
|
-
## Type Parameters
|
|
130
|
-
|
|
131
|
-
### T
|
|
132
|
-
|
|
133
|
-
`T`
|
|
134
|
-
|
|
135
|
-
## Parameters
|
|
136
|
-
|
|
137
|
-
### expr?
|
|
138
|
-
|
|
139
|
-
The condition to evaluate
|
|
140
|
-
|
|
141
|
-
`null` | `T`
|
|
142
|
-
|
|
143
|
-
## Returns
|
|
144
|
-
|
|
145
|
-
`any`
|
|
146
|
-
|
|
147
|
-
If the condition is true, test, otherwise skips
|
|
148
24
|
|
|
149
25
|
|
|
150
26
|
Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
|
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,80 +1 @@
|
|
|
1
|
-
// src/describeIf.ts
|
|
2
|
-
var describeIf = (expr) => expr ? describe : describe.skip;
|
|
3
|
-
|
|
4
|
-
// src/itIf.ts
|
|
5
|
-
var itIf = (expr) => expr ? it : it.skip;
|
|
6
|
-
|
|
7
|
-
// src/testIf.ts
|
|
8
|
-
var testIf = (expr) => expr ? test : test.skip;
|
|
9
|
-
|
|
10
|
-
// src/tags/config.ts
|
|
11
|
-
var NOT_SYMBOL = "!";
|
|
12
|
-
var AND_SYMBOL = "&&";
|
|
13
|
-
var OR_SYMBOL = "||";
|
|
14
|
-
|
|
15
|
-
// src/tags/regexps.ts
|
|
16
|
-
var AND_REGX = /\s*&&\s*/;
|
|
17
|
-
var OR_REGX = /\s*\|\|\s*/;
|
|
18
|
-
var PLAIN_REGX = /\s+`/;
|
|
19
|
-
var BAD_REGX = /^!.*$/;
|
|
20
|
-
var GOOD_REGX = /^[^!].*$/;
|
|
21
|
-
|
|
22
|
-
// src/tags/filter.ts
|
|
23
|
-
var matchFilter = (strParam = "") => (tags2) => {
|
|
24
|
-
const str = strParam.trim();
|
|
25
|
-
if (typeof tags2 === "string") {
|
|
26
|
-
tags2 = [tags2];
|
|
27
|
-
}
|
|
28
|
-
if (str.includes(OR_SYMBOL)) {
|
|
29
|
-
const include2 = goodTags(str.split(OR_REGX));
|
|
30
|
-
const exclude2 = badTags(str.split(OR_REGX));
|
|
31
|
-
if (exclude2.length === 0) {
|
|
32
|
-
return include2.length === 0 || include2.some((s) => tags2.includes(s));
|
|
33
|
-
}
|
|
34
|
-
if (include2.length === 0 && exclude2.length > 0) {
|
|
35
|
-
return exclude2.some((s) => !tags2.includes(s));
|
|
36
|
-
}
|
|
37
|
-
return include2.length === 0 || include2.some((s) => tags2.includes(s)) || exclude2.some((s) => !tags2.includes(s));
|
|
38
|
-
}
|
|
39
|
-
if (str.includes(AND_SYMBOL)) {
|
|
40
|
-
const include2 = goodTags(str.split(AND_REGX));
|
|
41
|
-
const exclude2 = badTags(str.split(AND_REGX));
|
|
42
|
-
return include2.every((s) => tags2.includes(s)) && !exclude2.some((s) => tags2.includes(s));
|
|
43
|
-
}
|
|
44
|
-
const include = goodTags(str.split(PLAIN_REGX));
|
|
45
|
-
const exclude = badTags(str.split(PLAIN_REGX));
|
|
46
|
-
return (include.length === 0 || include.some((s) => tags2.includes(s))) && !exclude.some((s) => tags2.includes(s));
|
|
47
|
-
};
|
|
48
|
-
var goodTags = (arr) => {
|
|
49
|
-
return arr.filter((s) => RegExp(GOOD_REGX).exec(s));
|
|
50
|
-
};
|
|
51
|
-
var badTags = (arr) => {
|
|
52
|
-
return arr.filter((s) => RegExp(BAD_REGX).exec(s)).map((s) => s.replace(NOT_SYMBOL, ""));
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// src/tags/index.ts
|
|
56
|
-
function tags(...tagLabels) {
|
|
57
|
-
const tagsParam = process.argv.indexOf("--tags");
|
|
58
|
-
const passedTags = tagsParam > 0 ? process.argv[tagsParam + 1] : void 0;
|
|
59
|
-
const filter = matchFilter(passedTags);
|
|
60
|
-
const chain = {};
|
|
61
|
-
const filterMatch = filter(tagLabels);
|
|
62
|
-
chain.describeIf = filterMatch ? describeIf : (_param) => describe.skip;
|
|
63
|
-
chain.itIf = filterMatch ? itIf : (_param) => it.skip;
|
|
64
|
-
chain.testIf = filterMatch ? testIf : (_param) => test.skip;
|
|
65
|
-
chain.describe = filterMatch ? globalThis.describe : globalThis.xdescribe;
|
|
66
|
-
chain.it = filterMatch ? globalThis.it : globalThis.xit;
|
|
67
|
-
chain.test = filterMatch ? globalThis.test : globalThis.xtest;
|
|
68
|
-
chain.test.only = globalThis.test.only;
|
|
69
|
-
chain.test.skip = globalThis.test.skip;
|
|
70
|
-
chain.xtest = globalThis.xtest;
|
|
71
|
-
chain.xit = globalThis.xit;
|
|
72
|
-
return chain;
|
|
73
|
-
}
|
|
74
|
-
export {
|
|
75
|
-
describeIf,
|
|
76
|
-
itIf,
|
|
77
|
-
tags,
|
|
78
|
-
testIf
|
|
79
|
-
};
|
|
80
1
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/jest-helpers",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.81",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jest",
|
|
@@ -29,31 +29,23 @@
|
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
31
|
"types": "./dist/neutral/index.d.ts",
|
|
32
|
-
"source": "./src/index.ts",
|
|
33
32
|
"default": "./dist/neutral/index.mjs"
|
|
34
33
|
},
|
|
35
34
|
"./package.json": "./package.json"
|
|
36
35
|
},
|
|
37
36
|
"module": "./dist/neutral/index.mjs",
|
|
38
|
-
"source": "./src/index.ts",
|
|
39
37
|
"types": "./dist/neutral/index.d.ts",
|
|
40
38
|
"files": [
|
|
41
39
|
"dist",
|
|
42
|
-
"src",
|
|
43
40
|
"!**/*.bench.*",
|
|
44
41
|
"!**/*.spec.*",
|
|
45
42
|
"!**/*.test.*"
|
|
46
43
|
],
|
|
47
44
|
"devDependencies": {
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@xylabs/ts-scripts-yarn3": "~7.3.2",
|
|
51
|
-
"@xylabs/tsconfig": "~7.3.2",
|
|
45
|
+
"@xylabs/ts-scripts-yarn3": "~7.4.11",
|
|
46
|
+
"@xylabs/tsconfig": "~7.4.11",
|
|
52
47
|
"typescript": "~5.9.3"
|
|
53
48
|
},
|
|
54
|
-
"peerDependencies": {
|
|
55
|
-
"jest": "*"
|
|
56
|
-
},
|
|
57
49
|
"engines": {
|
|
58
50
|
"node": ">=18"
|
|
59
51
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Conditionally runs or skips the describe
|
|
3
|
-
* @param expr The condition to evaluate
|
|
4
|
-
* @returns If the condition is true, describe, otherwise skips
|
|
5
|
-
*/
|
|
6
|
-
export declare const describeIf: <T>(expr?: T | null) => jest.Describe;
|
|
7
|
-
//# sourceMappingURL=describeIf.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"describeIf.d.ts","sourceRoot":"","sources":["../../src/describeIf.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,OAAO,CAAC,GAAG,IAAI,kBAAsC,CAAA"}
|
package/dist/neutral/itIf.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"itIf.d.ts","sourceRoot":"","sources":["../../src/itIf.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,OAAO,CAAC,GAAG,IAAI,YAA0B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/tags/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,MAAM,CAAA;AAE7B,eAAO,MAAM,UAAU,OAAO,CAAA;AAE9B,eAAO,MAAM,SAAS,OAAO,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/tags/filter.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,WAAW,GACnB,iBAAa,MACb,MAAM,MAAM,EAAE,YA0Bd,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAOA,wBAAgB,IAAI,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,uBAyB1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"regexps.d.ts","sourceRoot":"","sources":["../../../src/tags/regexps.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,QAAa,CAAA;AAElC,eAAO,MAAM,OAAO,QAAe,CAAA;AAEnC,eAAO,MAAM,UAAU,QAAS,CAAA;AAEhC,eAAO,MAAM,QAAQ,QAAU,CAAA;AAE/B,eAAO,MAAM,SAAS,QAAa,CAAA"}
|
package/dist/neutral/testIf.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testIf.d.ts","sourceRoot":"","sources":["../../src/testIf.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,OAAO,CAAC,GAAG,IAAI,YAA8B,CAAA"}
|
package/src/describeIf.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Conditionally runs or skips the describe
|
|
3
|
-
* @param expr The condition to evaluate
|
|
4
|
-
* @returns If the condition is true, describe, otherwise skips
|
|
5
|
-
*/
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
7
|
-
export const describeIf = <T>(expr?: T | null) => (expr ? describe : describe.skip)
|
package/src/index.ts
DELETED
package/src/itIf.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Conditionally runs or skips the it
|
|
3
|
-
* @param expr The condition to evaluate
|
|
4
|
-
* @returns If the condition is true, it, otherwise skips
|
|
5
|
-
*/
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
7
|
-
export const itIf = <T>(expr?: T | null) => (expr ? it : it.skip)
|
package/src/tags/config.ts
DELETED
package/src/tags/filter.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AND_SYMBOL, NOT_SYMBOL, OR_SYMBOL,
|
|
3
|
-
} from './config.ts'
|
|
4
|
-
import {
|
|
5
|
-
AND_REGX, BAD_REGX, GOOD_REGX, OR_REGX, PLAIN_REGX,
|
|
6
|
-
} from './regexps.ts'
|
|
7
|
-
|
|
8
|
-
// f.e. tag1 !tag2
|
|
9
|
-
// tag1 && tag2 && !tag3
|
|
10
|
-
// tag1 || tag2 || !tag3
|
|
11
|
-
|
|
12
|
-
// ATTENTION!!: cases with () not handled: f.e. (tag1 && tag2) || tag3 won`t work
|
|
13
|
-
|
|
14
|
-
export const matchFilter
|
|
15
|
-
= (strParam = '') =>
|
|
16
|
-
(tags: string[]) => {
|
|
17
|
-
const str = strParam.trim()
|
|
18
|
-
if (typeof tags === 'string') {
|
|
19
|
-
tags = [tags]
|
|
20
|
-
}
|
|
21
|
-
if (str.includes(OR_SYMBOL)) {
|
|
22
|
-
const include = goodTags(str.split(OR_REGX))
|
|
23
|
-
const exclude = badTags(str.split(OR_REGX))
|
|
24
|
-
if (exclude.length === 0) {
|
|
25
|
-
return include.length === 0 || include.some(s => tags.includes(s))
|
|
26
|
-
}
|
|
27
|
-
if (include.length === 0 && exclude.length > 0) {
|
|
28
|
-
return exclude.some(s => !tags.includes(s))
|
|
29
|
-
}
|
|
30
|
-
return include.length === 0 || include.some(s => tags.includes(s)) || exclude.some(s => !tags.includes(s))
|
|
31
|
-
}
|
|
32
|
-
if (str.includes(AND_SYMBOL)) {
|
|
33
|
-
const include = goodTags(str.split(AND_REGX))
|
|
34
|
-
const exclude = badTags(str.split(AND_REGX))
|
|
35
|
-
|
|
36
|
-
return include.every(s => tags.includes(s)) && !exclude.some(s => tags.includes(s))
|
|
37
|
-
}
|
|
38
|
-
const include = goodTags(str.split(PLAIN_REGX))
|
|
39
|
-
const exclude = badTags(str.split(PLAIN_REGX))
|
|
40
|
-
|
|
41
|
-
return (include.length === 0 || include.some(s => tags.includes(s))) && !exclude.some(s => tags.includes(s))
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const goodTags = (arr: string[]) => {
|
|
45
|
-
return arr.filter(s => RegExp(GOOD_REGX).exec(s))
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const badTags = (arr: string[]) => {
|
|
49
|
-
return arr.filter(s => RegExp(BAD_REGX).exec(s)).map(s => s.replace(NOT_SYMBOL, ''))
|
|
50
|
-
}
|
package/src/tags/index.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { describeIf } from '../describeIf.ts'
|
|
2
|
-
import { itIf } from '../itIf.ts'
|
|
3
|
-
import { testIf } from '../testIf.ts'
|
|
4
|
-
import { matchFilter } from './filter.ts'
|
|
5
|
-
|
|
6
|
-
// Based on https://www.npmjs.com/package/jest-tags/v/1.0.1
|
|
7
|
-
|
|
8
|
-
export function tags(...tagLabels: string[]) {
|
|
9
|
-
const tagsParam = process.argv.indexOf('--tags')
|
|
10
|
-
const passedTags = tagsParam > 0 ? process.argv[tagsParam + 1] : undefined
|
|
11
|
-
const filter = matchFilter(passedTags)
|
|
12
|
-
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
-
const chain: Record<string, any> = {}
|
|
15
|
-
|
|
16
|
-
const filterMatch = filter(tagLabels)
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
-
chain.describeIf = filterMatch ? describeIf : (_param: any) => describe.skip
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
-
chain.itIf = filterMatch ? itIf : (_param: any) => it.skip
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
-
chain.testIf = filterMatch ? testIf : (_param: any) => test.skip
|
|
24
|
-
chain.describe = filterMatch ? globalThis.describe : globalThis.xdescribe
|
|
25
|
-
chain.it = filterMatch ? globalThis.it : globalThis.xit
|
|
26
|
-
chain.test = filterMatch ? globalThis.test : globalThis.xtest
|
|
27
|
-
chain.test.only = globalThis.test.only
|
|
28
|
-
chain.test.skip = globalThis.test.skip
|
|
29
|
-
chain.xtest = globalThis.xtest
|
|
30
|
-
chain.xit = globalThis.xit
|
|
31
|
-
|
|
32
|
-
return chain
|
|
33
|
-
}
|
package/src/tags/regexps.ts
DELETED
package/src/testIf.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Conditionally runs or skips the test
|
|
3
|
-
* @param expr The condition to evaluate
|
|
4
|
-
* @returns If the condition is true, test, otherwise skips
|
|
5
|
-
*/
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
7
|
-
export const testIf = <T>(expr?: T | null) => (expr ? test : test.skip)
|