@xylabs/jest-helpers 2.12.13 → 2.12.15
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/dist/browser/describeIf.js +2 -1
- package/dist/browser/describeIf.js.map +1 -1
- package/dist/browser/index.cjs +63 -0
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +1 -0
- package/dist/browser/index.d.cts.map +1 -1
- package/dist/browser/index.d.mts +1 -0
- package/dist/browser/index.d.mts.map +1 -1
- package/dist/browser/index.d.ts +1 -0
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +84 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/itIf.js +2 -1
- package/dist/browser/itIf.js.map +1 -1
- package/dist/browser/tags/config.cjs +33 -0
- package/dist/browser/tags/config.cjs.map +1 -0
- package/dist/browser/tags/config.d.cts +5 -0
- package/dist/browser/tags/config.d.cts.map +1 -0
- package/dist/browser/tags/config.d.mts +5 -0
- package/dist/browser/tags/config.d.mts.map +1 -0
- package/dist/browser/tags/config.d.ts +5 -0
- package/dist/browser/tags/config.d.ts.map +1 -0
- package/dist/browser/tags/config.js +12 -0
- package/dist/browser/tags/config.js.map +1 -0
- package/dist/browser/tags/filter.cjs +72 -0
- package/dist/browser/tags/filter.cjs.map +1 -0
- package/dist/browser/tags/filter.d.cts +2 -0
- package/dist/browser/tags/filter.d.cts.map +1 -0
- package/dist/browser/tags/filter.d.mts +2 -0
- package/dist/browser/tags/filter.d.mts.map +1 -0
- package/dist/browser/tags/filter.d.ts +2 -0
- package/dist/browser/tags/filter.d.ts.map +1 -0
- package/dist/browser/tags/filter.js +49 -0
- package/dist/browser/tags/filter.js.map +1 -0
- package/dist/browser/tags/index.cjs +88 -0
- package/dist/browser/tags/index.cjs.map +1 -0
- package/dist/browser/tags/index.d.cts +3 -0
- package/dist/browser/tags/index.d.cts.map +1 -0
- package/dist/browser/tags/index.d.mts +3 -0
- package/dist/browser/tags/index.d.mts.map +1 -0
- package/dist/browser/tags/index.d.ts +3 -0
- package/dist/browser/tags/index.d.ts.map +1 -0
- package/dist/browser/tags/index.js +73 -0
- package/dist/browser/tags/index.js.map +1 -0
- package/dist/browser/tags/regexps.cjs +44 -0
- package/dist/browser/tags/regexps.cjs.map +1 -0
- package/dist/browser/tags/regexps.d.cts +7 -0
- package/dist/browser/tags/regexps.d.cts.map +1 -0
- package/dist/browser/tags/regexps.d.mts +7 -0
- package/dist/browser/tags/regexps.d.mts.map +1 -0
- package/dist/browser/tags/regexps.d.ts +7 -0
- package/dist/browser/tags/regexps.d.ts.map +1 -0
- package/dist/browser/tags/regexps.js +21 -0
- package/dist/browser/tags/regexps.js.map +1 -0
- package/dist/browser/tags/utils.cjs +36 -0
- package/dist/browser/tags/utils.cjs.map +1 -0
- package/dist/browser/tags/utils.d.cts +2 -0
- package/dist/browser/tags/utils.d.cts.map +1 -0
- package/dist/browser/tags/utils.d.mts +2 -0
- package/dist/browser/tags/utils.d.mts.map +1 -0
- package/dist/browser/tags/utils.d.ts +2 -0
- package/dist/browser/tags/utils.d.ts.map +1 -0
- package/dist/browser/tags/utils.js +13 -0
- package/dist/browser/tags/utils.js.map +1 -0
- package/dist/browser/testIf.js +2 -1
- package/dist/browser/testIf.js.map +1 -1
- package/dist/node/index.cjs +65 -0
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +1 -0
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.mts +1 -0
- package/dist/node/index.d.mts.map +1 -1
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +71 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/tags/config.cjs +40 -0
- package/dist/node/tags/config.cjs.map +1 -0
- package/dist/node/tags/config.d.cts +5 -0
- package/dist/node/tags/config.d.cts.map +1 -0
- package/dist/node/tags/config.d.mts +5 -0
- package/dist/node/tags/config.d.mts.map +1 -0
- package/dist/node/tags/config.d.ts +5 -0
- package/dist/node/tags/config.d.ts.map +1 -0
- package/dist/node/tags/config.js +12 -0
- package/dist/node/tags/config.js.map +1 -0
- package/dist/node/tags/filter.cjs +76 -0
- package/dist/node/tags/filter.cjs.map +1 -0
- package/dist/node/tags/filter.d.cts +2 -0
- package/dist/node/tags/filter.d.cts.map +1 -0
- package/dist/node/tags/filter.d.mts +2 -0
- package/dist/node/tags/filter.d.mts.map +1 -0
- package/dist/node/tags/filter.d.ts +2 -0
- package/dist/node/tags/filter.d.ts.map +1 -0
- package/dist/node/tags/filter.js +49 -0
- package/dist/node/tags/filter.js.map +1 -0
- package/dist/node/tags/index.cjs +93 -0
- package/dist/node/tags/index.cjs.map +1 -0
- package/dist/node/tags/index.d.cts +3 -0
- package/dist/node/tags/index.d.cts.map +1 -0
- package/dist/node/tags/index.d.mts +3 -0
- package/dist/node/tags/index.d.mts.map +1 -0
- package/dist/node/tags/index.d.ts +3 -0
- package/dist/node/tags/index.d.ts.map +1 -0
- package/dist/node/tags/index.js +73 -0
- package/dist/node/tags/index.js.map +1 -0
- package/dist/node/tags/regexps.cjs +53 -0
- package/dist/node/tags/regexps.cjs.map +1 -0
- package/dist/node/tags/regexps.d.cts +7 -0
- package/dist/node/tags/regexps.d.cts.map +1 -0
- package/dist/node/tags/regexps.d.mts +7 -0
- package/dist/node/tags/regexps.d.mts.map +1 -0
- package/dist/node/tags/regexps.d.ts +7 -0
- package/dist/node/tags/regexps.d.ts.map +1 -0
- package/dist/node/tags/regexps.js +21 -0
- package/dist/node/tags/regexps.js.map +1 -0
- package/dist/node/tags/utils.cjs +40 -0
- package/dist/node/tags/utils.cjs.map +1 -0
- package/dist/node/tags/utils.d.cts +2 -0
- package/dist/node/tags/utils.d.cts.map +1 -0
- package/dist/node/tags/utils.d.mts +2 -0
- package/dist/node/tags/utils.d.mts.map +1 -0
- package/dist/node/tags/utils.d.ts +2 -0
- package/dist/node/tags/utils.d.ts.map +1 -0
- package/dist/node/tags/utils.js +13 -0
- package/dist/node/tags/utils.js.map +1 -0
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/tags/config.ts +7 -0
- package/src/tags/filter.ts +46 -0
- package/src/tags/index.ts +25 -0
- package/src/tags/regexps.ts +17 -0
- package/src/tags/utils.ts +8 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,IAAI,KAA8B,CAAA;AAE/C,wBAAgB,IAAI,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,uBAe1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,IAAI,KAA8B,CAAA;AAE/C,wBAAgB,IAAI,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,uBAe1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,IAAI,KAA8B,CAAA;AAE/C,wBAAgB,IAAI,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,uBAe1C"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// src/tags/config.ts
|
|
10
|
+
var NOT_SYMBOL = "!";
|
|
11
|
+
var AND_SYMBOL = "&&";
|
|
12
|
+
var OR_SYMBOL = "||";
|
|
13
|
+
|
|
14
|
+
// src/tags/regexps.ts
|
|
15
|
+
var escape = (str) => str.split("").map((symbol) => `\\${symbol}`).join("");
|
|
16
|
+
var AND_REGX = new RegExp(`\\s*${escape(AND_SYMBOL)}\\s*`);
|
|
17
|
+
var OR_REGX = new RegExp(`\\s*${escape(OR_SYMBOL)}\\s*`);
|
|
18
|
+
var PLAIN_REGX = new RegExp("\\s+");
|
|
19
|
+
var BAD_REGX = new RegExp(`^${escape(NOT_SYMBOL)}.*$`);
|
|
20
|
+
var GOOD_REGX = new RegExp(`^[^${escape(NOT_SYMBOL)}].*$`);
|
|
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.length === 0 || 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) => s.match(GOOD_REGX));
|
|
50
|
+
};
|
|
51
|
+
var badTags = (arr) => {
|
|
52
|
+
return arr.filter((s) => s.match(BAD_REGX)).map((s) => s.replace(NOT_SYMBOL, ""));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// src/tags/index.ts
|
|
56
|
+
var argv = __require("minimist")(process.argv.slice(2));
|
|
57
|
+
var args = argv(process.argv.slice(2));
|
|
58
|
+
function tags(...tagLabels) {
|
|
59
|
+
const filter = matchFilter(args.tags);
|
|
60
|
+
const thisGlobal = global;
|
|
61
|
+
const chain = {};
|
|
62
|
+
const filterMatch = filter(tagLabels);
|
|
63
|
+
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest;
|
|
64
|
+
chain.test.only = thisGlobal.test.only;
|
|
65
|
+
chain.test.skip = thisGlobal.test.skip;
|
|
66
|
+
chain.xtest = thisGlobal.xtest;
|
|
67
|
+
return chain;
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
args,
|
|
71
|
+
tags
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tags/config.ts","../../../src/tags/regexps.ts","../../../src/tags/filter.ts","../../../src/tags/index.ts"],"sourcesContent":["export const NOT_SYMBOL = '!'\n\nexport const AND_SYMBOL = '&&'\n\nexport const OR_SYMBOL = '||'\n\nexport const RESERVED_COMMANDS = ['--tags']\n","import { AND_SYMBOL, NOT_SYMBOL, OR_SYMBOL } from './config'\n\nexport const escape = (str: string) =>\n str\n .split('')\n .map((symbol) => `\\\\${symbol}`)\n .join('')\n\nexport const AND_REGX = new RegExp(`\\\\s*${escape(AND_SYMBOL)}\\\\s*`)\n\nexport const OR_REGX = new RegExp(`\\\\s*${escape(OR_SYMBOL)}\\\\s*`)\n\nexport const PLAIN_REGX = new RegExp('\\\\s+')\n\nexport const BAD_REGX = new RegExp(`^${escape(NOT_SYMBOL)}.*$`)\n\nexport const GOOD_REGX = new RegExp(`^[^${escape(NOT_SYMBOL)}].*$`)\n","import { AND_SYMBOL, NOT_SYMBOL, OR_SYMBOL } from './config'\nimport { AND_REGX, BAD_REGX, GOOD_REGX, OR_REGX, PLAIN_REGX } from './regexps'\n\n// f.e. tag1 !tag2\n// tag1 && tag2 && !tag3\n// tag1 || tag2 || !tag3\n\n//ATTENTION!!: cases with () not handled: f.e. (tag1 && tag2) || tag3 won`t work\n\nexport const matchFilter =\n (strParam = '') =>\n (tags: string[]) => {\n const str = strParam.trim()\n if (typeof tags === 'string') {\n tags = [tags]\n }\n if (str.includes(OR_SYMBOL)) {\n const include = goodTags(str.split(OR_REGX))\n const exclude = badTags(str.split(OR_REGX))\n if (exclude.length === 0) {\n return include.length === 0 || include.some((s) => tags.includes(s))\n }\n if (include.length === 0 && exclude.length !== 0) {\n return exclude.some((s) => !tags.includes(s))\n }\n return include.length === 0 || include.some((s) => tags.includes(s)) || exclude.some((s) => !tags.includes(s))\n }\n if (str.includes(AND_SYMBOL)) {\n const include = goodTags(str.split(AND_REGX))\n const exclude = badTags(str.split(AND_REGX))\n\n return (include.length === 0 || include.every((s) => tags.includes(s))) && !exclude.some((s) => tags.includes(s))\n }\n const include = goodTags(str.split(PLAIN_REGX))\n const exclude = badTags(str.split(PLAIN_REGX))\n\n return (include.length === 0 || include.some((s) => tags.includes(s))) && !exclude.some((s) => tags.includes(s))\n }\n\nconst goodTags = (arr: string[]) => {\n return arr.filter((s) => s.match(GOOD_REGX))\n}\n\nconst badTags = (arr: string[]) => {\n return arr.filter((s) => s.match(BAD_REGX)).map((s) => s.replace(NOT_SYMBOL, ''))\n}\n","// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst argv = require('minimist')(process.argv.slice(2))\n\nimport { matchFilter } from './filter'\n\n//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1\n\nexport const args = argv(process.argv.slice(2))\n\nexport function tags(...tagLabels: string[]) {\n const filter = matchFilter(args.tags)\n const thisGlobal = global\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chain: Record<string, any> = {}\n\n const filterMatch = filter(tagLabels)\n\n chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest\n chain.test.only = thisGlobal.test.only\n chain.test.skip = thisGlobal.test.skip\n chain.xtest = thisGlobal.xtest\n\n return chain\n}\n"],"mappings":"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","names":["tags","include","exclude"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/tags/regexps.ts
|
|
21
|
+
var regexps_exports = {};
|
|
22
|
+
__export(regexps_exports, {
|
|
23
|
+
AND_REGX: () => AND_REGX,
|
|
24
|
+
BAD_REGX: () => BAD_REGX,
|
|
25
|
+
GOOD_REGX: () => GOOD_REGX,
|
|
26
|
+
OR_REGX: () => OR_REGX,
|
|
27
|
+
PLAIN_REGX: () => PLAIN_REGX,
|
|
28
|
+
escape: () => escape
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(regexps_exports);
|
|
31
|
+
|
|
32
|
+
// src/tags/config.ts
|
|
33
|
+
var NOT_SYMBOL = "!";
|
|
34
|
+
var AND_SYMBOL = "&&";
|
|
35
|
+
var OR_SYMBOL = "||";
|
|
36
|
+
|
|
37
|
+
// src/tags/regexps.ts
|
|
38
|
+
var escape = (str) => str.split("").map((symbol) => `\\${symbol}`).join("");
|
|
39
|
+
var AND_REGX = new RegExp(`\\s*${escape(AND_SYMBOL)}\\s*`);
|
|
40
|
+
var OR_REGX = new RegExp(`\\s*${escape(OR_SYMBOL)}\\s*`);
|
|
41
|
+
var PLAIN_REGX = new RegExp("\\s+");
|
|
42
|
+
var BAD_REGX = new RegExp(`^${escape(NOT_SYMBOL)}.*$`);
|
|
43
|
+
var GOOD_REGX = new RegExp(`^[^${escape(NOT_SYMBOL)}].*$`);
|
|
44
|
+
//# sourceMappingURL=regexps.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tags/regexps.ts","../../../src/tags/config.ts"],"sourcesContent":["import { AND_SYMBOL, NOT_SYMBOL, OR_SYMBOL } from './config'\n\nexport const escape = (str: string) =>\n str\n .split('')\n .map((symbol) => `\\\\${symbol}`)\n .join('')\n\nexport const AND_REGX = new RegExp(`\\\\s*${escape(AND_SYMBOL)}\\\\s*`)\n\nexport const OR_REGX = new RegExp(`\\\\s*${escape(OR_SYMBOL)}\\\\s*`)\n\nexport const PLAIN_REGX = new RegExp('\\\\s+')\n\nexport const BAD_REGX = new RegExp(`^${escape(NOT_SYMBOL)}.*$`)\n\nexport const GOOD_REGX = new RegExp(`^[^${escape(NOT_SYMBOL)}].*$`)\n","export const NOT_SYMBOL = '!'\n\nexport const AND_SYMBOL = '&&'\n\nexport const OR_SYMBOL = '||'\n\nexport const RESERVED_COMMANDS = ['--tags']\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,aAAa;AAEnB,IAAM,aAAa;AAEnB,IAAM,YAAY;;;ADFlB,IAAM,SAAS,CAAC,QACrB,IACG,MAAM,EAAE,EACR,IAAI,CAAC,WAAW,KAAK,MAAM,EAAE,EAC7B,KAAK,EAAE;AAEL,IAAM,WAAW,IAAI,OAAO,OAAO,OAAO,UAAU,CAAC,MAAM;AAE3D,IAAM,UAAU,IAAI,OAAO,OAAO,OAAO,SAAS,CAAC,MAAM;AAEzD,IAAM,aAAa,IAAI,OAAO,MAAM;AAEpC,IAAM,WAAW,IAAI,OAAO,IAAI,OAAO,UAAU,CAAC,KAAK;AAEvD,IAAM,YAAY,IAAI,OAAO,MAAM,OAAO,UAAU,CAAC,MAAM;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const escape: (str: string) => string;
|
|
2
|
+
export declare const AND_REGX: RegExp;
|
|
3
|
+
export declare const OR_REGX: RegExp;
|
|
4
|
+
export declare const PLAIN_REGX: RegExp;
|
|
5
|
+
export declare const BAD_REGX: RegExp;
|
|
6
|
+
export declare const GOOD_REGX: RegExp;
|
|
7
|
+
//# sourceMappingURL=regexps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexps.d.ts","sourceRoot":"","sources":["../../../src/tags/regexps.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,QAAS,MAAM,WAIrB,CAAA;AAEb,eAAO,MAAM,QAAQ,QAA8C,CAAA;AAEnE,eAAO,MAAM,OAAO,QAA6C,CAAA;AAEjE,eAAO,MAAM,UAAU,QAAqB,CAAA;AAE5C,eAAO,MAAM,QAAQ,QAA0C,CAAA;AAE/D,eAAO,MAAM,SAAS,QAA6C,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const escape: (str: string) => string;
|
|
2
|
+
export declare const AND_REGX: RegExp;
|
|
3
|
+
export declare const OR_REGX: RegExp;
|
|
4
|
+
export declare const PLAIN_REGX: RegExp;
|
|
5
|
+
export declare const BAD_REGX: RegExp;
|
|
6
|
+
export declare const GOOD_REGX: RegExp;
|
|
7
|
+
//# sourceMappingURL=regexps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexps.d.ts","sourceRoot":"","sources":["../../../src/tags/regexps.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,QAAS,MAAM,WAIrB,CAAA;AAEb,eAAO,MAAM,QAAQ,QAA8C,CAAA;AAEnE,eAAO,MAAM,OAAO,QAA6C,CAAA;AAEjE,eAAO,MAAM,UAAU,QAAqB,CAAA;AAE5C,eAAO,MAAM,QAAQ,QAA0C,CAAA;AAE/D,eAAO,MAAM,SAAS,QAA6C,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const escape: (str: string) => string;
|
|
2
|
+
export declare const AND_REGX: RegExp;
|
|
3
|
+
export declare const OR_REGX: RegExp;
|
|
4
|
+
export declare const PLAIN_REGX: RegExp;
|
|
5
|
+
export declare const BAD_REGX: RegExp;
|
|
6
|
+
export declare const GOOD_REGX: RegExp;
|
|
7
|
+
//# sourceMappingURL=regexps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexps.d.ts","sourceRoot":"","sources":["../../../src/tags/regexps.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,QAAS,MAAM,WAIrB,CAAA;AAEb,eAAO,MAAM,QAAQ,QAA8C,CAAA;AAEnE,eAAO,MAAM,OAAO,QAA6C,CAAA;AAEjE,eAAO,MAAM,UAAU,QAAqB,CAAA;AAE5C,eAAO,MAAM,QAAQ,QAA0C,CAAA;AAE/D,eAAO,MAAM,SAAS,QAA6C,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/tags/config.ts
|
|
2
|
+
var NOT_SYMBOL = "!";
|
|
3
|
+
var AND_SYMBOL = "&&";
|
|
4
|
+
var OR_SYMBOL = "||";
|
|
5
|
+
|
|
6
|
+
// src/tags/regexps.ts
|
|
7
|
+
var escape = (str) => str.split("").map((symbol) => `\\${symbol}`).join("");
|
|
8
|
+
var AND_REGX = new RegExp(`\\s*${escape(AND_SYMBOL)}\\s*`);
|
|
9
|
+
var OR_REGX = new RegExp(`\\s*${escape(OR_SYMBOL)}\\s*`);
|
|
10
|
+
var PLAIN_REGX = new RegExp("\\s+");
|
|
11
|
+
var BAD_REGX = new RegExp(`^${escape(NOT_SYMBOL)}.*$`);
|
|
12
|
+
var GOOD_REGX = new RegExp(`^[^${escape(NOT_SYMBOL)}].*$`);
|
|
13
|
+
export {
|
|
14
|
+
AND_REGX,
|
|
15
|
+
BAD_REGX,
|
|
16
|
+
GOOD_REGX,
|
|
17
|
+
OR_REGX,
|
|
18
|
+
PLAIN_REGX,
|
|
19
|
+
escape
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=regexps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tags/config.ts","../../../src/tags/regexps.ts"],"sourcesContent":["export const NOT_SYMBOL = '!'\n\nexport const AND_SYMBOL = '&&'\n\nexport const OR_SYMBOL = '||'\n\nexport const RESERVED_COMMANDS = ['--tags']\n","import { AND_SYMBOL, NOT_SYMBOL, OR_SYMBOL } from './config'\n\nexport const escape = (str: string) =>\n str\n .split('')\n .map((symbol) => `\\\\${symbol}`)\n .join('')\n\nexport const AND_REGX = new RegExp(`\\\\s*${escape(AND_SYMBOL)}\\\\s*`)\n\nexport const OR_REGX = new RegExp(`\\\\s*${escape(OR_SYMBOL)}\\\\s*`)\n\nexport const PLAIN_REGX = new RegExp('\\\\s+')\n\nexport const BAD_REGX = new RegExp(`^${escape(NOT_SYMBOL)}.*$`)\n\nexport const GOOD_REGX = new RegExp(`^[^${escape(NOT_SYMBOL)}].*$`)\n"],"mappings":";AAAO,IAAM,aAAa;AAEnB,IAAM,aAAa;AAEnB,IAAM,YAAY;;;ACFlB,IAAM,SAAS,CAAC,QACrB,IACG,MAAM,EAAE,EACR,IAAI,CAAC,WAAW,KAAK,MAAM,EAAE,EAC7B,KAAK,EAAE;AAEL,IAAM,WAAW,IAAI,OAAO,OAAO,OAAO,UAAU,CAAC,MAAM;AAE3D,IAAM,UAAU,IAAI,OAAO,OAAO,OAAO,SAAS,CAAC,MAAM;AAEzD,IAAM,aAAa,IAAI,OAAO,MAAM;AAEpC,IAAM,WAAW,IAAI,OAAO,IAAI,OAAO,UAAU,CAAC,KAAK;AAEvD,IAAM,YAAY,IAAI,OAAO,MAAM,OAAO,UAAU,CAAC,MAAM;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/tags/utils.ts
|
|
21
|
+
var utils_exports = {};
|
|
22
|
+
__export(utils_exports, {
|
|
23
|
+
getJestPassedParams: () => getJestPassedParams
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(utils_exports);
|
|
26
|
+
|
|
27
|
+
// src/tags/config.ts
|
|
28
|
+
var RESERVED_COMMANDS = ["--tags"];
|
|
29
|
+
|
|
30
|
+
// src/tags/utils.ts
|
|
31
|
+
var getJestPassedParams = (argv) => {
|
|
32
|
+
return [...argv, "-i"].filter((prop) => {
|
|
33
|
+
return prop.startsWith("-") && RESERVED_COMMANDS.every((command) => command !== prop);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tags/utils.ts","../../../src/tags/config.ts"],"sourcesContent":["import { RESERVED_COMMANDS } from './config'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getJestPassedParams = (argv: any) => {\n return [...argv, '-i'].filter((prop) => {\n return prop.startsWith('-') && RESERVED_COMMANDS.every((command) => command !== prop)\n })\n}\n","export const NOT_SYMBOL = '!'\n\nexport const AND_SYMBOL = '&&'\n\nexport const OR_SYMBOL = '||'\n\nexport const RESERVED_COMMANDS = ['--tags']\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMO,IAAM,oBAAoB,CAAC,QAAQ;;;ADHnC,IAAM,sBAAsB,CAAC,SAAc;AAChD,SAAO,CAAC,GAAG,MAAM,IAAI,EAAE,OAAO,CAAC,SAAS;AACtC,WAAO,KAAK,WAAW,GAAG,KAAK,kBAAkB,MAAM,CAAC,YAAY,YAAY,IAAI;AAAA,EACtF,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tags/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,SAAU,GAAG,UAI5C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tags/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,SAAU,GAAG,UAI5C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tags/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,SAAU,GAAG,UAI5C,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/tags/config.ts
|
|
2
|
+
var RESERVED_COMMANDS = ["--tags"];
|
|
3
|
+
|
|
4
|
+
// src/tags/utils.ts
|
|
5
|
+
var getJestPassedParams = (argv) => {
|
|
6
|
+
return [...argv, "-i"].filter((prop) => {
|
|
7
|
+
return prop.startsWith("-") && RESERVED_COMMANDS.every((command) => command !== prop);
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
getJestPassedParams
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tags/config.ts","../../../src/tags/utils.ts"],"sourcesContent":["export const NOT_SYMBOL = '!'\n\nexport const AND_SYMBOL = '&&'\n\nexport const OR_SYMBOL = '||'\n\nexport const RESERVED_COMMANDS = ['--tags']\n","import { RESERVED_COMMANDS } from './config'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getJestPassedParams = (argv: any) => {\n return [...argv, '-i'].filter((prop) => {\n return prop.startsWith('-') && RESERVED_COMMANDS.every((command) => command !== prop)\n })\n}\n"],"mappings":";AAMO,IAAM,oBAAoB,CAAC,QAAQ;;;ACHnC,IAAM,sBAAsB,CAAC,SAAc;AAChD,SAAO,CAAC,GAAG,MAAM,IAAI,EAAE,OAAO,CAAC,SAAS;AACtC,WAAO,KAAK,WAAW,GAAG,KAAK,kBAAkB,MAAM,CAAC,YAAY,YAAY,IAAI;AAAA,EACtF,CAAC;AACH;","names":[]}
|
package/dist/browser/testIf.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/testIf.ts"],"sourcesContent":["/**\n * Conditionally runs or skips the test\n * @param expr The condition to evaluate\n * @returns If the condition is true, test, otherwise skips\n */\nexport const testIf = <T>(expr?: T | null) => (expr ? test : test.skip)\n"],"mappings":"AAKO,
|
|
1
|
+
{"version":3,"sources":["../../src/testIf.ts"],"sourcesContent":["/**\n * Conditionally runs or skips the test\n * @param expr The condition to evaluate\n * @returns If the condition is true, test, otherwise skips\n */\nexport const testIf = <T>(expr?: T | null) => (expr ? test : test.skip)\n"],"mappings":";AAKO,IAAM,SAAS,CAAI,SAAqB,OAAO,OAAO,KAAK;","names":[]}
|
package/dist/node/index.cjs
CHANGED
|
@@ -20,8 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
|
+
args: () => args,
|
|
23
24
|
describeIf: () => describeIf,
|
|
24
25
|
itIf: () => itIf,
|
|
26
|
+
tags: () => tags,
|
|
25
27
|
testIf: () => testIf
|
|
26
28
|
});
|
|
27
29
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -32,12 +34,75 @@ var describeIf = (expr) => expr ? describe : describe.skip;
|
|
|
32
34
|
// src/itIf.ts
|
|
33
35
|
var itIf = (expr) => expr ? it : it.skip;
|
|
34
36
|
|
|
37
|
+
// src/tags/config.ts
|
|
38
|
+
var NOT_SYMBOL = "!";
|
|
39
|
+
var AND_SYMBOL = "&&";
|
|
40
|
+
var OR_SYMBOL = "||";
|
|
41
|
+
|
|
42
|
+
// src/tags/regexps.ts
|
|
43
|
+
var escape = (str) => str.split("").map((symbol) => `\\${symbol}`).join("");
|
|
44
|
+
var AND_REGX = new RegExp(`\\s*${escape(AND_SYMBOL)}\\s*`);
|
|
45
|
+
var OR_REGX = new RegExp(`\\s*${escape(OR_SYMBOL)}\\s*`);
|
|
46
|
+
var PLAIN_REGX = new RegExp("\\s+");
|
|
47
|
+
var BAD_REGX = new RegExp(`^${escape(NOT_SYMBOL)}.*$`);
|
|
48
|
+
var GOOD_REGX = new RegExp(`^[^${escape(NOT_SYMBOL)}].*$`);
|
|
49
|
+
|
|
50
|
+
// src/tags/filter.ts
|
|
51
|
+
var matchFilter = (strParam = "") => (tags2) => {
|
|
52
|
+
const str = strParam.trim();
|
|
53
|
+
if (typeof tags2 === "string") {
|
|
54
|
+
tags2 = [tags2];
|
|
55
|
+
}
|
|
56
|
+
if (str.includes(OR_SYMBOL)) {
|
|
57
|
+
const include2 = goodTags(str.split(OR_REGX));
|
|
58
|
+
const exclude2 = badTags(str.split(OR_REGX));
|
|
59
|
+
if (exclude2.length === 0) {
|
|
60
|
+
return include2.length === 0 || include2.some((s) => tags2.includes(s));
|
|
61
|
+
}
|
|
62
|
+
if (include2.length === 0 && exclude2.length !== 0) {
|
|
63
|
+
return exclude2.some((s) => !tags2.includes(s));
|
|
64
|
+
}
|
|
65
|
+
return include2.length === 0 || include2.some((s) => tags2.includes(s)) || exclude2.some((s) => !tags2.includes(s));
|
|
66
|
+
}
|
|
67
|
+
if (str.includes(AND_SYMBOL)) {
|
|
68
|
+
const include2 = goodTags(str.split(AND_REGX));
|
|
69
|
+
const exclude2 = badTags(str.split(AND_REGX));
|
|
70
|
+
return (include2.length === 0 || include2.every((s) => tags2.includes(s))) && !exclude2.some((s) => tags2.includes(s));
|
|
71
|
+
}
|
|
72
|
+
const include = goodTags(str.split(PLAIN_REGX));
|
|
73
|
+
const exclude = badTags(str.split(PLAIN_REGX));
|
|
74
|
+
return (include.length === 0 || include.some((s) => tags2.includes(s))) && !exclude.some((s) => tags2.includes(s));
|
|
75
|
+
};
|
|
76
|
+
var goodTags = (arr) => {
|
|
77
|
+
return arr.filter((s) => s.match(GOOD_REGX));
|
|
78
|
+
};
|
|
79
|
+
var badTags = (arr) => {
|
|
80
|
+
return arr.filter((s) => s.match(BAD_REGX)).map((s) => s.replace(NOT_SYMBOL, ""));
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// src/tags/index.ts
|
|
84
|
+
var argv = require("minimist")(process.argv.slice(2));
|
|
85
|
+
var args = argv(process.argv.slice(2));
|
|
86
|
+
function tags(...tagLabels) {
|
|
87
|
+
const filter = matchFilter(args.tags);
|
|
88
|
+
const thisGlobal = global;
|
|
89
|
+
const chain = {};
|
|
90
|
+
const filterMatch = filter(tagLabels);
|
|
91
|
+
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest;
|
|
92
|
+
chain.test.only = thisGlobal.test.only;
|
|
93
|
+
chain.test.skip = thisGlobal.test.skip;
|
|
94
|
+
chain.xtest = thisGlobal.xtest;
|
|
95
|
+
return chain;
|
|
96
|
+
}
|
|
97
|
+
|
|
35
98
|
// src/testIf.ts
|
|
36
99
|
var testIf = (expr) => expr ? test : test.skip;
|
|
37
100
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
101
|
0 && (module.exports = {
|
|
102
|
+
args,
|
|
39
103
|
describeIf,
|
|
40
104
|
itIf,
|
|
105
|
+
tags,
|
|
41
106
|
testIf
|
|
42
107
|
});
|
|
43
108
|
//# sourceMappingURL=index.cjs.map
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/describeIf.ts","../../src/itIf.ts","../../src/testIf.ts"],"sourcesContent":["export * from './describeIf'\nexport * from './itIf'\nexport * from './testIf'\n","/**\n * Conditionally runs or skips the describe\n * @param expr The condition to evaluate\n * @returns If the condition is true, describe, otherwise skips\n */\nexport const describeIf = <T>(expr?: T | null) => (expr ? describe : describe.skip)\n","/**\n * Conditionally runs or skips the it\n * @param expr The condition to evaluate\n * @returns If the condition is true, it, otherwise skips\n */\nexport const itIf = <T>(expr?: T | null) => (expr ? it : it.skip)\n","/**\n * Conditionally runs or skips the test\n * @param expr The condition to evaluate\n * @returns If the condition is true, test, otherwise skips\n */\nexport const testIf = <T>(expr?: T | null) => (expr ? test : test.skip)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,aAAa,CAAI,SAAqB,OAAO,WAAW,SAAS;;;ACAvE,IAAM,OAAO,CAAI,SAAqB,OAAO,KAAK,GAAG;;;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/describeIf.ts","../../src/itIf.ts","../../src/tags/config.ts","../../src/tags/regexps.ts","../../src/tags/filter.ts","../../src/tags/index.ts","../../src/testIf.ts"],"sourcesContent":["export * from './describeIf'\nexport * from './itIf'\nexport * from './tags'\nexport * from './testIf'\n","/**\n * Conditionally runs or skips the describe\n * @param expr The condition to evaluate\n * @returns If the condition is true, describe, otherwise skips\n */\nexport const describeIf = <T>(expr?: T | null) => (expr ? describe : describe.skip)\n","/**\n * Conditionally runs or skips the it\n * @param expr The condition to evaluate\n * @returns If the condition is true, it, otherwise skips\n */\nexport const itIf = <T>(expr?: T | null) => (expr ? it : it.skip)\n","export const NOT_SYMBOL = '!'\n\nexport const AND_SYMBOL = '&&'\n\nexport const OR_SYMBOL = '||'\n\nexport const RESERVED_COMMANDS = ['--tags']\n","import { AND_SYMBOL, NOT_SYMBOL, OR_SYMBOL } from './config'\n\nexport const escape = (str: string) =>\n str\n .split('')\n .map((symbol) => `\\\\${symbol}`)\n .join('')\n\nexport const AND_REGX = new RegExp(`\\\\s*${escape(AND_SYMBOL)}\\\\s*`)\n\nexport const OR_REGX = new RegExp(`\\\\s*${escape(OR_SYMBOL)}\\\\s*`)\n\nexport const PLAIN_REGX = new RegExp('\\\\s+')\n\nexport const BAD_REGX = new RegExp(`^${escape(NOT_SYMBOL)}.*$`)\n\nexport const GOOD_REGX = new RegExp(`^[^${escape(NOT_SYMBOL)}].*$`)\n","import { AND_SYMBOL, NOT_SYMBOL, OR_SYMBOL } from './config'\nimport { AND_REGX, BAD_REGX, GOOD_REGX, OR_REGX, PLAIN_REGX } from './regexps'\n\n// f.e. tag1 !tag2\n// tag1 && tag2 && !tag3\n// tag1 || tag2 || !tag3\n\n//ATTENTION!!: cases with () not handled: f.e. (tag1 && tag2) || tag3 won`t work\n\nexport const matchFilter =\n (strParam = '') =>\n (tags: string[]) => {\n const str = strParam.trim()\n if (typeof tags === 'string') {\n tags = [tags]\n }\n if (str.includes(OR_SYMBOL)) {\n const include = goodTags(str.split(OR_REGX))\n const exclude = badTags(str.split(OR_REGX))\n if (exclude.length === 0) {\n return include.length === 0 || include.some((s) => tags.includes(s))\n }\n if (include.length === 0 && exclude.length !== 0) {\n return exclude.some((s) => !tags.includes(s))\n }\n return include.length === 0 || include.some((s) => tags.includes(s)) || exclude.some((s) => !tags.includes(s))\n }\n if (str.includes(AND_SYMBOL)) {\n const include = goodTags(str.split(AND_REGX))\n const exclude = badTags(str.split(AND_REGX))\n\n return (include.length === 0 || include.every((s) => tags.includes(s))) && !exclude.some((s) => tags.includes(s))\n }\n const include = goodTags(str.split(PLAIN_REGX))\n const exclude = badTags(str.split(PLAIN_REGX))\n\n return (include.length === 0 || include.some((s) => tags.includes(s))) && !exclude.some((s) => tags.includes(s))\n }\n\nconst goodTags = (arr: string[]) => {\n return arr.filter((s) => s.match(GOOD_REGX))\n}\n\nconst badTags = (arr: string[]) => {\n return arr.filter((s) => s.match(BAD_REGX)).map((s) => s.replace(NOT_SYMBOL, ''))\n}\n","// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst argv = require('minimist')(process.argv.slice(2))\n\nimport { matchFilter } from './filter'\n\n//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1\n\nexport const args = argv(process.argv.slice(2))\n\nexport function tags(...tagLabels: string[]) {\n const filter = matchFilter(args.tags)\n const thisGlobal = global\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chain: Record<string, any> = {}\n\n const filterMatch = filter(tagLabels)\n\n chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest\n chain.test.only = thisGlobal.test.only\n chain.test.skip = thisGlobal.test.skip\n chain.xtest = thisGlobal.xtest\n\n return chain\n}\n","/**\n * Conditionally runs or skips the test\n * @param expr The condition to evaluate\n * @returns If the condition is true, test, otherwise skips\n */\nexport const testIf = <T>(expr?: T | null) => (expr ? test : test.skip)\n"],"mappings":"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","names":["tags","include","exclude"]}
|
package/dist/node/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA"}
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA"}
|
package/dist/node/index.d.ts
CHANGED
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA"}
|
package/dist/node/index.js
CHANGED
|
@@ -1,14 +1,85 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
1
9
|
// src/describeIf.ts
|
|
2
10
|
var describeIf = (expr) => expr ? describe : describe.skip;
|
|
3
11
|
|
|
4
12
|
// src/itIf.ts
|
|
5
13
|
var itIf = (expr) => expr ? it : it.skip;
|
|
6
14
|
|
|
15
|
+
// src/tags/config.ts
|
|
16
|
+
var NOT_SYMBOL = "!";
|
|
17
|
+
var AND_SYMBOL = "&&";
|
|
18
|
+
var OR_SYMBOL = "||";
|
|
19
|
+
|
|
20
|
+
// src/tags/regexps.ts
|
|
21
|
+
var escape = (str) => str.split("").map((symbol) => `\\${symbol}`).join("");
|
|
22
|
+
var AND_REGX = new RegExp(`\\s*${escape(AND_SYMBOL)}\\s*`);
|
|
23
|
+
var OR_REGX = new RegExp(`\\s*${escape(OR_SYMBOL)}\\s*`);
|
|
24
|
+
var PLAIN_REGX = new RegExp("\\s+");
|
|
25
|
+
var BAD_REGX = new RegExp(`^${escape(NOT_SYMBOL)}.*$`);
|
|
26
|
+
var GOOD_REGX = new RegExp(`^[^${escape(NOT_SYMBOL)}].*$`);
|
|
27
|
+
|
|
28
|
+
// src/tags/filter.ts
|
|
29
|
+
var matchFilter = (strParam = "") => (tags2) => {
|
|
30
|
+
const str = strParam.trim();
|
|
31
|
+
if (typeof tags2 === "string") {
|
|
32
|
+
tags2 = [tags2];
|
|
33
|
+
}
|
|
34
|
+
if (str.includes(OR_SYMBOL)) {
|
|
35
|
+
const include2 = goodTags(str.split(OR_REGX));
|
|
36
|
+
const exclude2 = badTags(str.split(OR_REGX));
|
|
37
|
+
if (exclude2.length === 0) {
|
|
38
|
+
return include2.length === 0 || include2.some((s) => tags2.includes(s));
|
|
39
|
+
}
|
|
40
|
+
if (include2.length === 0 && exclude2.length !== 0) {
|
|
41
|
+
return exclude2.some((s) => !tags2.includes(s));
|
|
42
|
+
}
|
|
43
|
+
return include2.length === 0 || include2.some((s) => tags2.includes(s)) || exclude2.some((s) => !tags2.includes(s));
|
|
44
|
+
}
|
|
45
|
+
if (str.includes(AND_SYMBOL)) {
|
|
46
|
+
const include2 = goodTags(str.split(AND_REGX));
|
|
47
|
+
const exclude2 = badTags(str.split(AND_REGX));
|
|
48
|
+
return (include2.length === 0 || include2.every((s) => tags2.includes(s))) && !exclude2.some((s) => tags2.includes(s));
|
|
49
|
+
}
|
|
50
|
+
const include = goodTags(str.split(PLAIN_REGX));
|
|
51
|
+
const exclude = badTags(str.split(PLAIN_REGX));
|
|
52
|
+
return (include.length === 0 || include.some((s) => tags2.includes(s))) && !exclude.some((s) => tags2.includes(s));
|
|
53
|
+
};
|
|
54
|
+
var goodTags = (arr) => {
|
|
55
|
+
return arr.filter((s) => s.match(GOOD_REGX));
|
|
56
|
+
};
|
|
57
|
+
var badTags = (arr) => {
|
|
58
|
+
return arr.filter((s) => s.match(BAD_REGX)).map((s) => s.replace(NOT_SYMBOL, ""));
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// src/tags/index.ts
|
|
62
|
+
var argv = __require("minimist")(process.argv.slice(2));
|
|
63
|
+
var args = argv(process.argv.slice(2));
|
|
64
|
+
function tags(...tagLabels) {
|
|
65
|
+
const filter = matchFilter(args.tags);
|
|
66
|
+
const thisGlobal = global;
|
|
67
|
+
const chain = {};
|
|
68
|
+
const filterMatch = filter(tagLabels);
|
|
69
|
+
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest;
|
|
70
|
+
chain.test.only = thisGlobal.test.only;
|
|
71
|
+
chain.test.skip = thisGlobal.test.skip;
|
|
72
|
+
chain.xtest = thisGlobal.xtest;
|
|
73
|
+
return chain;
|
|
74
|
+
}
|
|
75
|
+
|
|
7
76
|
// src/testIf.ts
|
|
8
77
|
var testIf = (expr) => expr ? test : test.skip;
|
|
9
78
|
export {
|
|
79
|
+
args,
|
|
10
80
|
describeIf,
|
|
11
81
|
itIf,
|
|
82
|
+
tags,
|
|
12
83
|
testIf
|
|
13
84
|
};
|
|
14
85
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/describeIf.ts","../../src/itIf.ts","../../src/testIf.ts"],"sourcesContent":["/**\n * Conditionally runs or skips the describe\n * @param expr The condition to evaluate\n * @returns If the condition is true, describe, otherwise skips\n */\nexport const describeIf = <T>(expr?: T | null) => (expr ? describe : describe.skip)\n","/**\n * Conditionally runs or skips the it\n * @param expr The condition to evaluate\n * @returns If the condition is true, it, otherwise skips\n */\nexport const itIf = <T>(expr?: T | null) => (expr ? it : it.skip)\n","/**\n * Conditionally runs or skips the test\n * @param expr The condition to evaluate\n * @returns If the condition is true, test, otherwise skips\n */\nexport const testIf = <T>(expr?: T | null) => (expr ? test : test.skip)\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/describeIf.ts","../../src/itIf.ts","../../src/tags/config.ts","../../src/tags/regexps.ts","../../src/tags/filter.ts","../../src/tags/index.ts","../../src/testIf.ts"],"sourcesContent":["/**\n * Conditionally runs or skips the describe\n * @param expr The condition to evaluate\n * @returns If the condition is true, describe, otherwise skips\n */\nexport const describeIf = <T>(expr?: T | null) => (expr ? describe : describe.skip)\n","/**\n * Conditionally runs or skips the it\n * @param expr The condition to evaluate\n * @returns If the condition is true, it, otherwise skips\n */\nexport const itIf = <T>(expr?: T | null) => (expr ? it : it.skip)\n","export const NOT_SYMBOL = '!'\n\nexport const AND_SYMBOL = '&&'\n\nexport const OR_SYMBOL = '||'\n\nexport const RESERVED_COMMANDS = ['--tags']\n","import { AND_SYMBOL, NOT_SYMBOL, OR_SYMBOL } from './config'\n\nexport const escape = (str: string) =>\n str\n .split('')\n .map((symbol) => `\\\\${symbol}`)\n .join('')\n\nexport const AND_REGX = new RegExp(`\\\\s*${escape(AND_SYMBOL)}\\\\s*`)\n\nexport const OR_REGX = new RegExp(`\\\\s*${escape(OR_SYMBOL)}\\\\s*`)\n\nexport const PLAIN_REGX = new RegExp('\\\\s+')\n\nexport const BAD_REGX = new RegExp(`^${escape(NOT_SYMBOL)}.*$`)\n\nexport const GOOD_REGX = new RegExp(`^[^${escape(NOT_SYMBOL)}].*$`)\n","import { AND_SYMBOL, NOT_SYMBOL, OR_SYMBOL } from './config'\nimport { AND_REGX, BAD_REGX, GOOD_REGX, OR_REGX, PLAIN_REGX } from './regexps'\n\n// f.e. tag1 !tag2\n// tag1 && tag2 && !tag3\n// tag1 || tag2 || !tag3\n\n//ATTENTION!!: cases with () not handled: f.e. (tag1 && tag2) || tag3 won`t work\n\nexport const matchFilter =\n (strParam = '') =>\n (tags: string[]) => {\n const str = strParam.trim()\n if (typeof tags === 'string') {\n tags = [tags]\n }\n if (str.includes(OR_SYMBOL)) {\n const include = goodTags(str.split(OR_REGX))\n const exclude = badTags(str.split(OR_REGX))\n if (exclude.length === 0) {\n return include.length === 0 || include.some((s) => tags.includes(s))\n }\n if (include.length === 0 && exclude.length !== 0) {\n return exclude.some((s) => !tags.includes(s))\n }\n return include.length === 0 || include.some((s) => tags.includes(s)) || exclude.some((s) => !tags.includes(s))\n }\n if (str.includes(AND_SYMBOL)) {\n const include = goodTags(str.split(AND_REGX))\n const exclude = badTags(str.split(AND_REGX))\n\n return (include.length === 0 || include.every((s) => tags.includes(s))) && !exclude.some((s) => tags.includes(s))\n }\n const include = goodTags(str.split(PLAIN_REGX))\n const exclude = badTags(str.split(PLAIN_REGX))\n\n return (include.length === 0 || include.some((s) => tags.includes(s))) && !exclude.some((s) => tags.includes(s))\n }\n\nconst goodTags = (arr: string[]) => {\n return arr.filter((s) => s.match(GOOD_REGX))\n}\n\nconst badTags = (arr: string[]) => {\n return arr.filter((s) => s.match(BAD_REGX)).map((s) => s.replace(NOT_SYMBOL, ''))\n}\n","// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst argv = require('minimist')(process.argv.slice(2))\n\nimport { matchFilter } from './filter'\n\n//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1\n\nexport const args = argv(process.argv.slice(2))\n\nexport function tags(...tagLabels: string[]) {\n const filter = matchFilter(args.tags)\n const thisGlobal = global\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chain: Record<string, any> = {}\n\n const filterMatch = filter(tagLabels)\n\n chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest\n chain.test.only = thisGlobal.test.only\n chain.test.skip = thisGlobal.test.skip\n chain.xtest = thisGlobal.xtest\n\n return chain\n}\n","/**\n * Conditionally runs or skips the test\n * @param expr The condition to evaluate\n * @returns If the condition is true, test, otherwise skips\n */\nexport const testIf = <T>(expr?: T | null) => (expr ? test : test.skip)\n"],"mappings":"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","names":["tags","include","exclude"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/tags/config.ts
|
|
21
|
+
var config_exports = {};
|
|
22
|
+
__export(config_exports, {
|
|
23
|
+
AND_SYMBOL: () => AND_SYMBOL,
|
|
24
|
+
NOT_SYMBOL: () => NOT_SYMBOL,
|
|
25
|
+
OR_SYMBOL: () => OR_SYMBOL,
|
|
26
|
+
RESERVED_COMMANDS: () => RESERVED_COMMANDS
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(config_exports);
|
|
29
|
+
var NOT_SYMBOL = "!";
|
|
30
|
+
var AND_SYMBOL = "&&";
|
|
31
|
+
var OR_SYMBOL = "||";
|
|
32
|
+
var RESERVED_COMMANDS = ["--tags"];
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
AND_SYMBOL,
|
|
36
|
+
NOT_SYMBOL,
|
|
37
|
+
OR_SYMBOL,
|
|
38
|
+
RESERVED_COMMANDS
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=config.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tags/config.ts"],"sourcesContent":["export const NOT_SYMBOL = '!'\n\nexport const AND_SYMBOL = '&&'\n\nexport const OR_SYMBOL = '||'\n\nexport const RESERVED_COMMANDS = ['--tags']\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,aAAa;AAEnB,IAAM,aAAa;AAEnB,IAAM,YAAY;AAElB,IAAM,oBAAoB,CAAC,QAAQ;","names":[]}
|