@xylabs/jest-helpers 2.12.16 → 2.12.18
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/index.cjs +4 -3
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +4 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/tags/index.cjs +7 -3
- package/dist/browser/tags/index.cjs.map +1 -1
- package/dist/browser/tags/index.d.cts +0 -1
- package/dist/browser/tags/index.d.cts.map +1 -1
- package/dist/browser/tags/index.d.mts +0 -1
- package/dist/browser/tags/index.d.mts.map +1 -1
- package/dist/browser/tags/index.d.ts +0 -1
- package/dist/browser/tags/index.d.ts.map +1 -1
- package/dist/browser/tags/index.js +7 -3
- package/dist/browser/tags/index.js.map +1 -1
- package/dist/node/index.cjs +4 -4
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +4 -3
- package/dist/node/index.js.map +1 -1
- package/dist/node/tags/index.cjs +7 -4
- package/dist/node/tags/index.cjs.map +1 -1
- package/dist/node/tags/index.d.cts +0 -1
- package/dist/node/tags/index.d.cts.map +1 -1
- package/dist/node/tags/index.d.mts +0 -1
- package/dist/node/tags/index.d.mts.map +1 -1
- package/dist/node/tags/index.d.ts +0 -1
- package/dist/node/tags/index.d.ts.map +1 -1
- package/dist/node/tags/index.js +7 -3
- package/dist/node/tags/index.js.map +1 -1
- package/package.json +1 -1
- package/src/tags/index.ts +5 -3
package/dist/browser/index.cjs
CHANGED
|
@@ -20,7 +20,6 @@ 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,
|
|
24
23
|
describeIf: () => describeIf,
|
|
25
24
|
itIf: () => itIf,
|
|
26
25
|
tags: () => tags,
|
|
@@ -82,12 +81,14 @@ var badTags = (arr) => {
|
|
|
82
81
|
|
|
83
82
|
// src/tags/index.ts
|
|
84
83
|
var argv = require("minimist")(process.argv.slice(2));
|
|
85
|
-
var args = argv(process.argv.slice(2));
|
|
86
84
|
function tags(...tagLabels) {
|
|
87
|
-
const filter = matchFilter(
|
|
85
|
+
const filter = matchFilter(argv.tags);
|
|
88
86
|
const thisGlobal = global;
|
|
89
87
|
const chain = {};
|
|
90
88
|
const filterMatch = filter(tagLabels);
|
|
89
|
+
chain.describeIf = describeIf;
|
|
90
|
+
chain.describe = thisGlobal.describe;
|
|
91
|
+
chain.it = thisGlobal.it;
|
|
91
92
|
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest;
|
|
92
93
|
chain.test.only = thisGlobal.test.only;
|
|
93
94
|
chain.test.skip = thisGlobal.test.skip;
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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 { describeIf } from '../describeIf'\nimport { matchFilter } from './filter'\n\n//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1\n\nexport function tags(...tagLabels: string[]) {\n const filter = matchFilter(argv.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.describeIf = describeIf\n chain.describe = thisGlobal.describe\n chain.it = thisGlobal.it\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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KAAK,WAAW;AACtB,QAAM,OAAO,cAAc,WAAW,OAAO,WAAW;AACxD,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,QAAQ,WAAW;AAEzB,SAAO;AACT;;;ACrBO,IAAM,SAAS,CAAI,SAAqB,OAAO,OAAO,KAAK;","names":["tags","include","exclude"]}
|
package/dist/browser/index.js
CHANGED
|
@@ -60,12 +60,14 @@ var badTags = (arr) => {
|
|
|
60
60
|
|
|
61
61
|
// src/tags/index.ts
|
|
62
62
|
var argv = __require("minimist")(process.argv.slice(2));
|
|
63
|
-
var args = argv(process.argv.slice(2));
|
|
64
63
|
function tags(...tagLabels) {
|
|
65
|
-
const filter = matchFilter(
|
|
64
|
+
const filter = matchFilter(argv.tags);
|
|
66
65
|
const thisGlobal = global;
|
|
67
66
|
const chain = {};
|
|
68
67
|
const filterMatch = filter(tagLabels);
|
|
68
|
+
chain.describeIf = describeIf;
|
|
69
|
+
chain.describe = thisGlobal.describe;
|
|
70
|
+
chain.it = thisGlobal.it;
|
|
69
71
|
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest;
|
|
70
72
|
chain.test.only = thisGlobal.test.only;
|
|
71
73
|
chain.test.skip = thisGlobal.test.skip;
|
|
@@ -76,7 +78,6 @@ function tags(...tagLabels) {
|
|
|
76
78
|
// src/testIf.ts
|
|
77
79
|
var testIf = (expr) => expr ? test : test.skip;
|
|
78
80
|
export {
|
|
79
|
-
args,
|
|
80
81
|
describeIf,
|
|
81
82
|
itIf,
|
|
82
83
|
tags,
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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 { describeIf } from '../describeIf'\nimport { matchFilter } from './filter'\n\n//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1\n\nexport function tags(...tagLabels: string[]) {\n const filter = matchFilter(argv.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.describeIf = describeIf\n chain.describe = thisGlobal.describe\n chain.it = thisGlobal.it\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":";;;;;;;;;AAKO,IAAM,aAAa,CAAI,SAAqB,OAAO,WAAW,SAAS;;;ACAvE,IAAM,OAAO,CAAI,SAAqB,OAAO,KAAK,GAAG;;;ACLrD,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;;;ACP3D,IAAM,cACX,CAAC,WAAW,OACZ,CAACA,UAAmB;AAClB,QAAM,MAAM,SAAS,KAAK;AAC1B,MAAI,OAAOA,UAAS,UAAU;AAC5B,IAAAA,QAAO,CAACA,KAAI;AAAA,EACd;AACA,MAAI,IAAI,SAAS,SAAS,GAAG;AAC3B,UAAMC,WAAU,SAAS,IAAI,MAAM,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,IAAI,CAAC,MAAM,EAAE,QAAQ,YAAY,EAAE,CAAC;AAClF;;;AC5CA,IAAM,OAAO,UAAQ,UAAU,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC;AAO/C,SAAS,QAAQ,WAAqB;AAC3C,QAAM,SAAS,YAAY,KAAK,IAAI;AACpC,QAAM,aAAa;AAGnB,QAAM,QAA6B,CAAC;AAEpC,QAAM,cAAc,OAAO,SAAS;AAEpC,QAAM,aAAa;AACnB,QAAM,WAAW,WAAW;AAC5B,QAAM,KAAK,WAAW;AACtB,QAAM,OAAO,cAAc,WAAW,OAAO,WAAW;AACxD,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,QAAQ,WAAW;AAEzB,SAAO;AACT;;;ACrBO,IAAM,SAAS,CAAI,SAAqB,OAAO,OAAO,KAAK;","names":["tags","include","exclude"]}
|
|
@@ -20,11 +20,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/tags/index.ts
|
|
21
21
|
var tags_exports = {};
|
|
22
22
|
__export(tags_exports, {
|
|
23
|
-
args: () => args,
|
|
24
23
|
tags: () => tags
|
|
25
24
|
});
|
|
26
25
|
module.exports = __toCommonJS(tags_exports);
|
|
27
26
|
|
|
27
|
+
// src/describeIf.ts
|
|
28
|
+
var describeIf = (expr) => expr ? describe : describe.skip;
|
|
29
|
+
|
|
28
30
|
// src/tags/config.ts
|
|
29
31
|
var NOT_SYMBOL = "!";
|
|
30
32
|
var AND_SYMBOL = "&&";
|
|
@@ -73,12 +75,14 @@ var badTags = (arr) => {
|
|
|
73
75
|
|
|
74
76
|
// src/tags/index.ts
|
|
75
77
|
var argv = require("minimist")(process.argv.slice(2));
|
|
76
|
-
var args = argv(process.argv.slice(2));
|
|
77
78
|
function tags(...tagLabels) {
|
|
78
|
-
const filter = matchFilter(
|
|
79
|
+
const filter = matchFilter(argv.tags);
|
|
79
80
|
const thisGlobal = global;
|
|
80
81
|
const chain = {};
|
|
81
82
|
const filterMatch = filter(tagLabels);
|
|
83
|
+
chain.describeIf = describeIf;
|
|
84
|
+
chain.describe = thisGlobal.describe;
|
|
85
|
+
chain.it = thisGlobal.it;
|
|
82
86
|
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest;
|
|
83
87
|
chain.test.only = thisGlobal.test.only;
|
|
84
88
|
chain.test.skip = thisGlobal.test.skip;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/tags/index.ts","../../../src/tags/config.ts","../../../src/tags/regexps.ts","../../../src/tags/filter.ts"],"sourcesContent":["// 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
|
|
1
|
+
{"version":3,"sources":["../../../src/tags/index.ts","../../../src/describeIf.ts","../../../src/tags/config.ts","../../../src/tags/regexps.ts","../../../src/tags/filter.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst argv = require('minimist')(process.argv.slice(2))\n\nimport { describeIf } from '../describeIf'\nimport { matchFilter } from './filter'\n\n//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1\n\nexport function tags(...tagLabels: string[]) {\n const filter = matchFilter(argv.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.describeIf = describeIf\n chain.describe = thisGlobal.describe\n chain.it = thisGlobal.it\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 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","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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,aAAa,CAAI,SAAqB,OAAO,WAAW,SAAS;;;ACLvE,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;;;ACP3D,IAAM,cACX,CAAC,WAAW,OACZ,CAACA,UAAmB;AAClB,QAAM,MAAM,SAAS,KAAK;AAC1B,MAAI,OAAOA,UAAS,UAAU;AAC5B,IAAAA,QAAO,CAACA,KAAI;AAAA,EACd;AACA,MAAI,IAAI,SAAS,SAAS,GAAG;AAC3B,UAAMC,WAAU,SAAS,IAAI,MAAM,OAAO,CAAC;AAC3C,UAAMC,WAAU,QAAQ,IAAI,MAAM,OAAO,CAAC;AAC1C,QAAIA,SAAQ,WAAW,GAAG;AACxB,aAAOD,SAAQ,WAAW,KAAKA,SAAQ,KAAK,CAAC,MAAMD,MAAK,SAAS,CAAC,CAAC;AAAA,IACrE;AACA,QAA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AAM,aAAa;AAGnB,QAAM,QAA6B,CAAC;AAEpC,QAAM,cAAc,OAAO,SAAS;AAEpC,QAAM,aAAa;AACnB,QAAM,WAAW,WAAW;AAC5B,QAAM,KAAK,WAAW;AACtB,QAAM,OAAO,cAAc,WAAW,OAAO,WAAW;AACxD,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,QAAQ,WAAW;AAEzB,SAAO;AACT;","names":["tags","include","exclude"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAQA,wBAAgB,IAAI,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,uBAkB1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAQA,wBAAgB,IAAI,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,uBAkB1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAQA,wBAAgB,IAAI,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,uBAkB1C"}
|
|
@@ -6,6 +6,9 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
6
6
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
+
// src/describeIf.ts
|
|
10
|
+
var describeIf = (expr) => expr ? describe : describe.skip;
|
|
11
|
+
|
|
9
12
|
// src/tags/config.ts
|
|
10
13
|
var NOT_SYMBOL = "!";
|
|
11
14
|
var AND_SYMBOL = "&&";
|
|
@@ -54,12 +57,14 @@ var badTags = (arr) => {
|
|
|
54
57
|
|
|
55
58
|
// src/tags/index.ts
|
|
56
59
|
var argv = __require("minimist")(process.argv.slice(2));
|
|
57
|
-
var args = argv(process.argv.slice(2));
|
|
58
60
|
function tags(...tagLabels) {
|
|
59
|
-
const filter = matchFilter(
|
|
61
|
+
const filter = matchFilter(argv.tags);
|
|
60
62
|
const thisGlobal = global;
|
|
61
63
|
const chain = {};
|
|
62
64
|
const filterMatch = filter(tagLabels);
|
|
65
|
+
chain.describeIf = describeIf;
|
|
66
|
+
chain.describe = thisGlobal.describe;
|
|
67
|
+
chain.it = thisGlobal.it;
|
|
63
68
|
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest;
|
|
64
69
|
chain.test.only = thisGlobal.test.only;
|
|
65
70
|
chain.test.skip = thisGlobal.test.skip;
|
|
@@ -67,7 +72,6 @@ function tags(...tagLabels) {
|
|
|
67
72
|
return chain;
|
|
68
73
|
}
|
|
69
74
|
export {
|
|
70
|
-
args,
|
|
71
75
|
tags
|
|
72
76
|
};
|
|
73
77
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +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
|
|
1
|
+
{"version":3,"sources":["../../../src/describeIf.ts","../../../src/tags/config.ts","../../../src/tags/regexps.ts","../../../src/tags/filter.ts","../../../src/tags/index.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","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 { describeIf } from '../describeIf'\nimport { matchFilter } from './filter'\n\n//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1\n\nexport function tags(...tagLabels: string[]) {\n const filter = matchFilter(argv.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.describeIf = describeIf\n chain.describe = thisGlobal.describe\n chain.it = thisGlobal.it\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":";;;;;;;;;AAKO,IAAM,aAAa,CAAI,SAAqB,OAAO,WAAW,SAAS;;;ACLvE,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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AACE,SAAQ,KAAK,CAAC,MAAMF,MAAK,SAAS,CAAC,CAAC;AAAA,EAClH;AACA,QAAM,UAAU,SAAS,IAAI,MAAM,UAAU,CAAC;AAC9C,QAAM,UAAU,QAAQ,IAAI,MAAM,UAAU,CAAC;AAE7C,UAAQ,QAAQ,WAAW,KAAK,QAAQ,KAAK,CAAC,MAAMA,MAAK,SAAS,CAAC,CAAC,MAAM,CAAC,QAAQ,KAAK,CAAC,MAAMA,MAAK,SAAS,CAAC,CAAC;AACjH;AAEF,IAAM,WAAW,CAAC,QAAkB;AAClC,SAAO,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C;AAEA,IAAM,UAAU,CAAC,QAAkB;AACjC,SAAO,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,YAAY,EAAE,CAAC;AAClF;;;AC5CA,IAAM,OAAO,UAAQ,UAAU,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC;AAO/C,SAAS,QAAQ,WAAqB;AAC3C,QAAM,SAAS,YAAY,KAAK,IAAI;AACpC,QAAM,aAAa;AAGnB,QAAM,QAA6B,CAAC;AAEpC,QAAM,cAAc,OAAO,SAAS;AAEpC,QAAM,aAAa;AACnB,QAAM,WAAW,WAAW;AAC5B,QAAM,KAAK,WAAW;AACtB,QAAM,OAAO,cAAc,WAAW,OAAO,WAAW;AACxD,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,QAAQ,WAAW;AAEzB,SAAO;AACT;","names":["tags","include","exclude"]}
|
package/dist/node/index.cjs
CHANGED
|
@@ -20,7 +20,6 @@ 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,
|
|
24
23
|
describeIf: () => describeIf,
|
|
25
24
|
itIf: () => itIf,
|
|
26
25
|
tags: () => tags,
|
|
@@ -82,12 +81,14 @@ var badTags = (arr) => {
|
|
|
82
81
|
|
|
83
82
|
// src/tags/index.ts
|
|
84
83
|
var argv = require("minimist")(process.argv.slice(2));
|
|
85
|
-
var args = argv(process.argv.slice(2));
|
|
86
84
|
function tags(...tagLabels) {
|
|
87
|
-
const filter = matchFilter(
|
|
85
|
+
const filter = matchFilter(argv.tags);
|
|
88
86
|
const thisGlobal = global;
|
|
89
87
|
const chain = {};
|
|
90
88
|
const filterMatch = filter(tagLabels);
|
|
89
|
+
chain.describeIf = describeIf;
|
|
90
|
+
chain.describe = thisGlobal.describe;
|
|
91
|
+
chain.it = thisGlobal.it;
|
|
91
92
|
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest;
|
|
92
93
|
chain.test.only = thisGlobal.test.only;
|
|
93
94
|
chain.test.skip = thisGlobal.test.skip;
|
|
@@ -99,7 +100,6 @@ function tags(...tagLabels) {
|
|
|
99
100
|
var testIf = (expr) => expr ? test : test.skip;
|
|
100
101
|
// Annotate the CommonJS export names for ESM import in node:
|
|
101
102
|
0 && (module.exports = {
|
|
102
|
-
args,
|
|
103
103
|
describeIf,
|
|
104
104
|
itIf,
|
|
105
105
|
tags,
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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 { describeIf } from '../describeIf'\nimport { matchFilter } from './filter'\n\n//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1\n\nexport function tags(...tagLabels: string[]) {\n const filter = matchFilter(argv.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.describeIf = describeIf\n chain.describe = thisGlobal.describe\n chain.it = thisGlobal.it\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,aAAa,CAAI,SAAqB,OAAO,WAAW,SAAS;;;ACAvE,IAAM,OAAO,CAAI,SAAqB,OAAO,KAAK,GAAG;;;ACLrD,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;;;ACP3D,IAAM,cACX,CAAC,WAAW,OACZ,CAACA,UAAmB;AAClB,QAAM,MAAM,SAAS,KAAK;AAC1B,MAAI,OAAOA,UAAS,UAAU;AAC5B,IAAAA,QAAO,CAACA,KAAI;AAAA,EACd;AACA,MAAI,IAAI,SAAS,SAAS,GAAG;AAC3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AM,EAAE,MAAM,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,YAAY,EAAE,CAAC;AAClF;;;AC5CA,IAAM,OAAO,QAAQ,UAAU,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC;AAO/C,SAAS,QAAQ,WAAqB;AAC3C,QAAM,SAAS,YAAY,KAAK,IAAI;AACpC,QAAM,aAAa;AAGnB,QAAM,QAA6B,CAAC;AAEpC,QAAM,cAAc,OAAO,SAAS;AAEpC,QAAM,aAAa;AACnB,QAAM,WAAW,WAAW;AAC5B,QAAM,KAAK,WAAW;AACtB,QAAM,OAAO,cAAc,WAAW,OAAO,WAAW;AACxD,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,QAAQ,WAAW;AAEzB,SAAO;AACT;;;ACrBO,IAAM,SAAS,CAAI,SAAqB,OAAO,OAAO,KAAK;","names":["tags","include","exclude"]}
|
package/dist/node/index.js
CHANGED
|
@@ -60,12 +60,14 @@ var badTags = (arr) => {
|
|
|
60
60
|
|
|
61
61
|
// src/tags/index.ts
|
|
62
62
|
var argv = __require("minimist")(process.argv.slice(2));
|
|
63
|
-
var args = argv(process.argv.slice(2));
|
|
64
63
|
function tags(...tagLabels) {
|
|
65
|
-
const filter = matchFilter(
|
|
64
|
+
const filter = matchFilter(argv.tags);
|
|
66
65
|
const thisGlobal = global;
|
|
67
66
|
const chain = {};
|
|
68
67
|
const filterMatch = filter(tagLabels);
|
|
68
|
+
chain.describeIf = describeIf;
|
|
69
|
+
chain.describe = thisGlobal.describe;
|
|
70
|
+
chain.it = thisGlobal.it;
|
|
69
71
|
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest;
|
|
70
72
|
chain.test.only = thisGlobal.test.only;
|
|
71
73
|
chain.test.skip = thisGlobal.test.skip;
|
|
@@ -76,7 +78,6 @@ function tags(...tagLabels) {
|
|
|
76
78
|
// src/testIf.ts
|
|
77
79
|
var testIf = (expr) => expr ? test : test.skip;
|
|
78
80
|
export {
|
|
79
|
-
args,
|
|
80
81
|
describeIf,
|
|
81
82
|
itIf,
|
|
82
83
|
tags,
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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 { describeIf } from '../describeIf'\nimport { matchFilter } from './filter'\n\n//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1\n\nexport function tags(...tagLabels: string[]) {\n const filter = matchFilter(argv.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.describeIf = describeIf\n chain.describe = thisGlobal.describe\n chain.it = thisGlobal.it\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":";;;;;;;;;AAKO,IAAM,aAAa,CAAI,SAAqB,OAAO,WAAW,SAAS;;;ACAvE,IAAM,OAAO,CAAI,SAAqB,OAAO,KAAK,GAAG;;;ACLrD,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,IA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,QAAQ,IAAI,MAAM,UAAU,CAAC;AAE7C,UAAQ,QAAQ,WAAW,KAAK,QAAQ,KAAK,CAAC,MAAMA,MAAK,SAAS,CAAC,CAAC,MAAM,CAAC,QAAQ,KAAK,CAAC,MAAMA,MAAK,SAAS,CAAC,CAAC;AACjH;AAEF,IAAM,WAAW,CAAC,QAAkB;AAClC,SAAO,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C;AAEA,IAAM,UAAU,CAAC,QAAkB;AACjC,SAAO,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,YAAY,EAAE,CAAC;AAClF;;;AC5CA,IAAM,OAAO,UAAQ,UAAU,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC;AAO/C,SAAS,QAAQ,WAAqB;AAC3C,QAAM,SAAS,YAAY,KAAK,IAAI;AACpC,QAAM,aAAa;AAGnB,QAAM,QAA6B,CAAC;AAEpC,QAAM,cAAc,OAAO,SAAS;AAEpC,QAAM,aAAa;AACnB,QAAM,WAAW,WAAW;AAC5B,QAAM,KAAK,WAAW;AACtB,QAAM,OAAO,cAAc,WAAW,OAAO,WAAW;AACxD,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,QAAQ,WAAW;AAEzB,SAAO;AACT;;;ACrBO,IAAM,SAAS,CAAI,SAAqB,OAAO,OAAO,KAAK;","names":["tags","include","exclude"]}
|
package/dist/node/tags/index.cjs
CHANGED
|
@@ -20,11 +20,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/tags/index.ts
|
|
21
21
|
var tags_exports = {};
|
|
22
22
|
__export(tags_exports, {
|
|
23
|
-
args: () => args,
|
|
24
23
|
tags: () => tags
|
|
25
24
|
});
|
|
26
25
|
module.exports = __toCommonJS(tags_exports);
|
|
27
26
|
|
|
27
|
+
// src/describeIf.ts
|
|
28
|
+
var describeIf = (expr) => expr ? describe : describe.skip;
|
|
29
|
+
|
|
28
30
|
// src/tags/config.ts
|
|
29
31
|
var NOT_SYMBOL = "!";
|
|
30
32
|
var AND_SYMBOL = "&&";
|
|
@@ -73,12 +75,14 @@ var badTags = (arr) => {
|
|
|
73
75
|
|
|
74
76
|
// src/tags/index.ts
|
|
75
77
|
var argv = require("minimist")(process.argv.slice(2));
|
|
76
|
-
var args = argv(process.argv.slice(2));
|
|
77
78
|
function tags(...tagLabels) {
|
|
78
|
-
const filter = matchFilter(
|
|
79
|
+
const filter = matchFilter(argv.tags);
|
|
79
80
|
const thisGlobal = global;
|
|
80
81
|
const chain = {};
|
|
81
82
|
const filterMatch = filter(tagLabels);
|
|
83
|
+
chain.describeIf = describeIf;
|
|
84
|
+
chain.describe = thisGlobal.describe;
|
|
85
|
+
chain.it = thisGlobal.it;
|
|
82
86
|
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest;
|
|
83
87
|
chain.test.only = thisGlobal.test.only;
|
|
84
88
|
chain.test.skip = thisGlobal.test.skip;
|
|
@@ -87,7 +91,6 @@ function tags(...tagLabels) {
|
|
|
87
91
|
}
|
|
88
92
|
// Annotate the CommonJS export names for ESM import in node:
|
|
89
93
|
0 && (module.exports = {
|
|
90
|
-
args,
|
|
91
94
|
tags
|
|
92
95
|
});
|
|
93
96
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/tags/index.ts","../../../src/tags/config.ts","../../../src/tags/regexps.ts","../../../src/tags/filter.ts"],"sourcesContent":["// 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
|
|
1
|
+
{"version":3,"sources":["../../../src/tags/index.ts","../../../src/describeIf.ts","../../../src/tags/config.ts","../../../src/tags/regexps.ts","../../../src/tags/filter.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst argv = require('minimist')(process.argv.slice(2))\n\nimport { describeIf } from '../describeIf'\nimport { matchFilter } from './filter'\n\n//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1\n\nexport function tags(...tagLabels: string[]) {\n const filter = matchFilter(argv.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.describeIf = describeIf\n chain.describe = thisGlobal.describe\n chain.it = thisGlobal.it\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 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","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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,aAAa,CAAI,SAAqB,OAAO,WAAW,SAAS;;;ACLvE,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,SA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,CAAC;AAC9C,QAAM,UAAU,QAAQ,IAAI,MAAM,UAAU,CAAC;AAE7C,UAAQ,QAAQ,WAAW,KAAK,QAAQ,KAAK,CAAC,MAAMA,MAAK,SAAS,CAAC,CAAC,MAAM,CAAC,QAAQ,KAAK,CAAC,MAAMA,MAAK,SAAS,CAAC,CAAC;AACjH;AAEF,IAAM,WAAW,CAAC,QAAkB;AAClC,SAAO,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C;AAEA,IAAM,UAAU,CAAC,QAAkB;AACjC,SAAO,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,YAAY,EAAE,CAAC;AAClF;;;AJ5CA,IAAM,OAAO,QAAQ,UAAU,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC;AAO/C,SAAS,QAAQ,WAAqB;AAC3C,QAAM,SAAS,YAAY,KAAK,IAAI;AACpC,QAAM,aAAa;AAGnB,QAAM,QAA6B,CAAC;AAEpC,QAAM,cAAc,OAAO,SAAS;AAEpC,QAAM,aAAa;AACnB,QAAM,WAAW,WAAW;AAC5B,QAAM,KAAK,WAAW;AACtB,QAAM,OAAO,cAAc,WAAW,OAAO,WAAW;AACxD,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,QAAQ,WAAW;AAEzB,SAAO;AACT;","names":["tags","include","exclude"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAQA,wBAAgB,IAAI,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,uBAkB1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAQA,wBAAgB,IAAI,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,uBAkB1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAQA,wBAAgB,IAAI,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,uBAkB1C"}
|
package/dist/node/tags/index.js
CHANGED
|
@@ -6,6 +6,9 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
6
6
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
+
// src/describeIf.ts
|
|
10
|
+
var describeIf = (expr) => expr ? describe : describe.skip;
|
|
11
|
+
|
|
9
12
|
// src/tags/config.ts
|
|
10
13
|
var NOT_SYMBOL = "!";
|
|
11
14
|
var AND_SYMBOL = "&&";
|
|
@@ -54,12 +57,14 @@ var badTags = (arr) => {
|
|
|
54
57
|
|
|
55
58
|
// src/tags/index.ts
|
|
56
59
|
var argv = __require("minimist")(process.argv.slice(2));
|
|
57
|
-
var args = argv(process.argv.slice(2));
|
|
58
60
|
function tags(...tagLabels) {
|
|
59
|
-
const filter = matchFilter(
|
|
61
|
+
const filter = matchFilter(argv.tags);
|
|
60
62
|
const thisGlobal = global;
|
|
61
63
|
const chain = {};
|
|
62
64
|
const filterMatch = filter(tagLabels);
|
|
65
|
+
chain.describeIf = describeIf;
|
|
66
|
+
chain.describe = thisGlobal.describe;
|
|
67
|
+
chain.it = thisGlobal.it;
|
|
63
68
|
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest;
|
|
64
69
|
chain.test.only = thisGlobal.test.only;
|
|
65
70
|
chain.test.skip = thisGlobal.test.skip;
|
|
@@ -67,7 +72,6 @@ function tags(...tagLabels) {
|
|
|
67
72
|
return chain;
|
|
68
73
|
}
|
|
69
74
|
export {
|
|
70
|
-
args,
|
|
71
75
|
tags
|
|
72
76
|
};
|
|
73
77
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +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
|
|
1
|
+
{"version":3,"sources":["../../../src/describeIf.ts","../../../src/tags/config.ts","../../../src/tags/regexps.ts","../../../src/tags/filter.ts","../../../src/tags/index.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","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 { describeIf } from '../describeIf'\nimport { matchFilter } from './filter'\n\n//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1\n\nexport function tags(...tagLabels: string[]) {\n const filter = matchFilter(argv.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.describeIf = describeIf\n chain.describe = thisGlobal.describe\n chain.it = thisGlobal.it\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":";;;;;;;;;AAKO,IAAM,aAAa,CAAI,SAAqB,OAAO,WAAW,SAAS;;;ACLvE,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;;;ACP3D,IAAM,cACX,CAAC,WAAW,OACZ,CAACA,UAAmB;AAClB,QAAM,MAAM,SAAS,KAAK;AAC1B,MAAI,OAAOA,UAAS,UAAU;AAC5B,IAAAA,QAAO,CAACA,KAAI;AAAA,EACd;AACA,MAAI,IAAI,SAAS,SAAS,GAAG;AAC3B,UAAMC,WAAU,SAAS,IAAI,MAAM,OAAO,CAAC;AAC3C,UAAMC,WAAU,QAAQ,IAAI,MAAM,OAAO,CAAC;AAC1C,QAAIA,SAAQ,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UAAU,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC;AAO/C,SAAS,QAAQ,WAAqB;AAC3C,QAAM,SAAS,YAAY,KAAK,IAAI;AACpC,QAAM,aAAa;AAGnB,QAAM,QAA6B,CAAC;AAEpC,QAAM,cAAc,OAAO,SAAS;AAEpC,QAAM,aAAa;AACnB,QAAM,WAAW,WAAW;AAC5B,QAAM,KAAK,WAAW;AACtB,QAAM,OAAO,cAAc,WAAW,OAAO,WAAW;AACxD,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,KAAK,OAAO,WAAW,KAAK;AAClC,QAAM,QAAQ,WAAW;AAEzB,SAAO;AACT;","names":["tags","include","exclude"]}
|
package/package.json
CHANGED
package/src/tags/index.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
2
2
|
const argv = require('minimist')(process.argv.slice(2))
|
|
3
3
|
|
|
4
|
+
import { describeIf } from '../describeIf'
|
|
4
5
|
import { matchFilter } from './filter'
|
|
5
6
|
|
|
6
7
|
//Based on https://www.npmjs.com/package/jest-tags/v/1.0.1
|
|
7
8
|
|
|
8
|
-
export const args = argv(process.argv.slice(2))
|
|
9
|
-
|
|
10
9
|
export function tags(...tagLabels: string[]) {
|
|
11
|
-
const filter = matchFilter(
|
|
10
|
+
const filter = matchFilter(argv.tags)
|
|
12
11
|
const thisGlobal = global
|
|
13
12
|
|
|
14
13
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -16,6 +15,9 @@ export function tags(...tagLabels: string[]) {
|
|
|
16
15
|
|
|
17
16
|
const filterMatch = filter(tagLabels)
|
|
18
17
|
|
|
18
|
+
chain.describeIf = describeIf
|
|
19
|
+
chain.describe = thisGlobal.describe
|
|
20
|
+
chain.it = thisGlobal.it
|
|
19
21
|
chain.test = filterMatch ? thisGlobal.test : thisGlobal.xtest
|
|
20
22
|
chain.test.only = thisGlobal.test.only
|
|
21
23
|
chain.test.skip = thisGlobal.test.skip
|