@flemist/test-variants 0.0.0 → 0.0.1
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/LICENSE +5 -0
- package/README.md +4 -0
- package/dist/browser/browser.js +20 -20
- package/dist/node/test-variants/createTestVariants.cjs +9 -13
- package/package.json +48 -45
package/LICENSE
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Unlimited Free Licence
|
|
2
|
+
|
|
3
|
+
Point one: Everyone can do whatever they want with this code, except to limit others from using point one.
|
|
4
|
+
Point two: Whoever and whatever does with this code, it does not entail any obligations for anyone to the author.
|
|
5
|
+
Point three: The author is not responsible for anything.
|
package/README.md
CHANGED
|
@@ -60,6 +60,10 @@ const count = await testVariants({
|
|
|
60
60
|
})
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
+
# License
|
|
64
|
+
|
|
65
|
+
[Unlimited Free](LICENSE)
|
|
66
|
+
|
|
63
67
|
[npm-image]: https://img.shields.io/npm/v/@flemist/test-variants.svg
|
|
64
68
|
[npm-url]: https://npmjs.org/package/@flemist/test-variants
|
|
65
69
|
[downloads-image]: https://img.shields.io/npm/dm/@flemist/test-variants.svg
|
package/dist/browser/browser.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
!function(r){"use strict";function
|
|
2
|
-
return function(
|
|
3
|
-
var e=Object.keys(
|
|
4
|
-
;function
|
|
5
|
-
;return"function"==typeof
|
|
6
|
-
for(var
|
|
7
|
-
;function
|
|
8
|
-
;if(
|
|
9
|
-
for(
|
|
10
|
-
;if(0===
|
|
11
|
-
if(r>=c)return!0}}return!1}
|
|
12
|
-
;function
|
|
13
|
-
console.error(JSON.stringify(
|
|
1
|
+
!function(r){"use strict";function n(r,n){
|
|
2
|
+
return function(t){
|
|
3
|
+
var e=Object.keys(t),o=Object.values(t),c=e.length,u={}
|
|
4
|
+
;function f(r){var n=o[r]
|
|
5
|
+
;return"function"==typeof n&&(n=n(u)),n}
|
|
6
|
+
for(var i=[],a=[],s=0;s<c;s++)i[s]=-1,a[s]=[]
|
|
7
|
+
;function l(){for(var r=c-1;r>=0;r--){var n=i[r]+1
|
|
8
|
+
;if(n<a[r].length){
|
|
9
|
+
for(i[r]=n,u[e[r]]=a[r][n],r++;r<c;r++){var t=f(r)
|
|
10
|
+
;if(0===t.length)break;i[r]=0,a[r]=t,u[e[r]]=t[0]}
|
|
11
|
+
if(r>=c)return!0}}return!1}a[0]=f(0)
|
|
12
|
+
;var v=0,h=!1,y=0;function b(r){
|
|
13
|
+
console.error(JSON.stringify(u,null,2)),console.error(r)
|
|
14
14
|
;var n=Date.now()
|
|
15
|
-
;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
;throw Date.now()-n>5&&y<5&&(h=!0,g(),y++),r}
|
|
16
|
+
function g(){for(;h||l();)try{v++;var t=r(u)
|
|
17
|
+
;if(t&&"function"==typeof t.then)return n&&b(new Error("Unexpected Promise result for sync test function")),
|
|
18
|
+
t.then(g).catch(b)}catch(r){b(r)}return v}
|
|
19
|
+
return g()}}r.createTestVariants=function(r){
|
|
20
|
+
return n(r,!1)
|
|
21
21
|
},r.createTestVariantsSync=function(r){
|
|
22
|
-
return
|
|
22
|
+
return n(r,!0)
|
|
23
23
|
},Object.defineProperty(r,"__esModule",{value:!0})
|
|
24
24
|
}({});
|
|
@@ -46,6 +46,8 @@ function _createTestVariants(test, sync) {
|
|
|
46
46
|
return false;
|
|
47
47
|
}
|
|
48
48
|
let iteration = 0;
|
|
49
|
+
let debug = false;
|
|
50
|
+
let debugIteration = 0;
|
|
49
51
|
function onError(err) {
|
|
50
52
|
console.error(JSON.stringify(variantArgs, null, 2));
|
|
51
53
|
console.error(err);
|
|
@@ -53,21 +55,15 @@ function _createTestVariants(test, sync) {
|
|
|
53
55
|
const time0 = Date.now();
|
|
54
56
|
// eslint-disable-next-line no-debugger
|
|
55
57
|
debugger;
|
|
56
|
-
if (Date.now() - time0 > 5) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
catch (_a) {
|
|
62
|
-
// eslint-disable-next-line no-debugger
|
|
63
|
-
debugger;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
58
|
+
if (Date.now() - time0 > 5 && debugIteration < 5) {
|
|
59
|
+
debug = true;
|
|
60
|
+
next();
|
|
61
|
+
debugIteration++;
|
|
66
62
|
}
|
|
67
63
|
throw err;
|
|
68
64
|
}
|
|
69
|
-
|
|
70
|
-
while (nextVariant()) {
|
|
65
|
+
function next() {
|
|
66
|
+
while (debug || nextVariant()) {
|
|
71
67
|
try {
|
|
72
68
|
iteration++;
|
|
73
69
|
const promise = test(variantArgs);
|
|
@@ -83,7 +79,7 @@ function _createTestVariants(test, sync) {
|
|
|
83
79
|
}
|
|
84
80
|
}
|
|
85
81
|
return iteration;
|
|
86
|
-
}
|
|
82
|
+
}
|
|
87
83
|
return next();
|
|
88
84
|
};
|
|
89
85
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flemist/test-variants",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"description": "Runs a test function with all possible combinations of its parameters.",
|
|
5
5
|
"main": "dist/node/index.cjs",
|
|
6
6
|
"types": "dist/node/index.d.ts",
|
|
7
7
|
"engines": {
|
|
8
|
-
"
|
|
8
|
+
"node": ">=9.3.0",
|
|
9
|
+
"pnpm": "^7.1.6"
|
|
9
10
|
},
|
|
10
11
|
"repository": {
|
|
11
12
|
"type": "git",
|
|
@@ -18,82 +19,84 @@
|
|
|
18
19
|
"enumeration",
|
|
19
20
|
"helper"
|
|
20
21
|
],
|
|
21
|
-
"author":
|
|
22
|
-
|
|
22
|
+
"author": {
|
|
23
|
+
"name": "Nikolay Makhonin",
|
|
24
|
+
"url": "https://github.com/NikolayMakhonin/"
|
|
25
|
+
},
|
|
26
|
+
"license": "Unlimited Free",
|
|
23
27
|
"bugs": {
|
|
24
28
|
"url": "https://github.com/NikolayMakhonin/test-variants/issues"
|
|
25
29
|
},
|
|
26
|
-
"homepage": "https://github.com/NikolayMakhonin/test-variants
|
|
30
|
+
"homepage": "https://github.com/NikolayMakhonin/test-variants",
|
|
27
31
|
"publishConfig": {
|
|
28
32
|
"access": "public"
|
|
29
33
|
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"prepublishOnly": "yarn build && yarn run test:mocha:ci && yarn run test:karma",
|
|
32
|
-
"lint": "eslint \"./src/**/*.{ts,js,cjs,mjs}\"",
|
|
33
|
-
"lint:fix": "eslint --fix \"./src/**/*.{ts,js,cjs,mjs}\"",
|
|
34
|
-
"build:js": "rollup -c && cpy \"**/assets/**\" \"../dist/\" --parents --cwd=src",
|
|
35
|
-
"build:types": "tsc --outDir dist/node --declaration",
|
|
36
|
-
"build": "rimraf dist && yarn run build:js && yarn run build:types",
|
|
37
|
-
"coverage:merge": "rimraf tmp/coverage/{all,merge} && cp-flat \"tmp/coverage/*/json/**/*.json\" \"tmp/coverage/merge\" && nyc report -r lcov --report-dir tmp/coverage/all/lcov --temp-dir \"tmp/coverage/merge/\"",
|
|
38
|
-
"coverage:check": "yarn run coverage:merge && nyc check-coverage --report-dir tmp/coverage/all/lcov --lines 50 --functions 50 --branches 50 --statements 50",
|
|
39
|
-
"test:mocha": "mocha ./src/**/*.test.ts",
|
|
40
|
-
"test:mocha:coverage": "rimraf tmp/coverage/mocha && nyc --all mocha ./src/**/*.test.ts",
|
|
41
|
-
"test:mocha:watch": "mocha --watch ./src/**/*.test.ts",
|
|
42
|
-
"test:karma": "rimraf tmp/coverage/karma && karma start --single-run --log-level debug",
|
|
43
|
-
"test:mocha:ci": "rimraf tmp/coverage/mocha && nyc --all mocha ./src/**/*.test.ts ./dist/**/*.test.cjs",
|
|
44
|
-
"coveralls": "yarn run coverage:check && nyc report --reporter=text-lcov --temp-dir \"tmp/coverage/merge/\" | coveralls"
|
|
45
|
-
},
|
|
46
34
|
"devDependencies": {
|
|
47
|
-
"@babel/core": "^7.18.
|
|
35
|
+
"@babel/core": "^7.18.5",
|
|
48
36
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
49
|
-
"@babel/plugin-transform-classes": "^7.
|
|
50
|
-
"@babel/plugin-transform-runtime": "^7.18.
|
|
51
|
-
"@babel/preset-env": "^7.18.
|
|
52
|
-
"@babel/runtime-corejs3": "^7.18.
|
|
37
|
+
"@babel/plugin-transform-classes": "^7.18.4",
|
|
38
|
+
"@babel/plugin-transform-runtime": "^7.18.5",
|
|
39
|
+
"@babel/preset-env": "^7.18.2",
|
|
40
|
+
"@babel/runtime-corejs3": "^7.18.3",
|
|
53
41
|
"@flemist/copy-glob-flat": "^0.0.5",
|
|
54
42
|
"@flemist/karma-custom-launcher": "^0.0.0",
|
|
55
43
|
"@rollup/plugin-alias": "^3.1.9",
|
|
56
44
|
"@rollup/plugin-babel": "^5.3.1",
|
|
57
|
-
"@rollup/plugin-commonjs": "^21.0
|
|
45
|
+
"@rollup/plugin-commonjs": "^21.1.0",
|
|
58
46
|
"@rollup/plugin-inject": "^4.0.4",
|
|
59
47
|
"@rollup/plugin-json": "^4.1.0",
|
|
60
48
|
"@rollup/plugin-multi-entry": "^4.1.0",
|
|
61
|
-
"@rollup/plugin-node-resolve": "^13.
|
|
49
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
62
50
|
"@rollup/plugin-replace": "^4.0.0",
|
|
63
|
-
"@rollup/plugin-typescript": "^8.3.
|
|
51
|
+
"@rollup/plugin-typescript": "^8.3.3",
|
|
64
52
|
"@types/assert": "^1.5.6",
|
|
65
53
|
"@types/fs-extra": "^9.0.13",
|
|
66
|
-
"@types/mocha": "^9.1.
|
|
67
|
-
"@types/node": "^17.0.
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"eslint-config-pro": "^2.1.1",
|
|
73
|
-
"fs-extra": "^10.0.1",
|
|
54
|
+
"@types/mocha": "^9.1.1",
|
|
55
|
+
"@types/node": "^17.0.45",
|
|
56
|
+
"cpy-cli": "^4.1.0",
|
|
57
|
+
"eslint": "^8.17.0",
|
|
58
|
+
"eslint-config-pro": "^3.0.10",
|
|
59
|
+
"fs-extra": "^10.1.0",
|
|
74
60
|
"globby": "^11.1.0",
|
|
75
|
-
"karma": "^6.
|
|
61
|
+
"karma": "^6.4.0",
|
|
76
62
|
"karma-chrome-launcher": "^3.1.1",
|
|
77
63
|
"karma-coverage": "^2.2.0",
|
|
78
64
|
"karma-firefox-launcher": "^2.1.2",
|
|
79
65
|
"karma-mocha": "^2.0.1",
|
|
80
66
|
"karma-safari-launcher": "^1.0.0",
|
|
81
67
|
"mocha": "^9.2.2",
|
|
82
|
-
"nodemon": "^2.0.
|
|
68
|
+
"nodemon": "^2.0.16",
|
|
83
69
|
"nyc": "^15.1.0",
|
|
84
70
|
"rdtsc": "^2.0.0",
|
|
85
71
|
"rimraf": "^3.0.2",
|
|
86
|
-
"rollup": "^2.
|
|
72
|
+
"rollup": "^2.75.6",
|
|
87
73
|
"rollup-plugin-delete": "^2.0.0",
|
|
88
74
|
"rollup-plugin-istanbul": "^3.0.0",
|
|
89
75
|
"rollup-plugin-multi-input": "^1.3.1",
|
|
90
76
|
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
91
77
|
"rollup-plugin-terser": "^7.0.2",
|
|
92
|
-
"ts-node": "^10.
|
|
93
|
-
"tsconfig-paths": "^
|
|
94
|
-
"typescript": "^4.
|
|
78
|
+
"ts-node": "^10.8.1",
|
|
79
|
+
"tsconfig-paths": "^4.0.0",
|
|
80
|
+
"typescript": "^4.7.3"
|
|
95
81
|
},
|
|
96
82
|
"dependencies": {
|
|
97
|
-
"tslib": "^2.
|
|
83
|
+
"tslib": "^2.4.0"
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"audit": "pnpm audit --prod",
|
|
87
|
+
"lint": "eslint ./**/*.{js,cjs,mjs,ts,tsx}",
|
|
88
|
+
"lint:fix": "eslint --fix ./**/*.{js,cjs,mjs,ts,tsx}",
|
|
89
|
+
"lint:wizard": "eslint-nibble --cache --multi ./**/*.{js,cjs,mjs,ts,tsx}",
|
|
90
|
+
"build:js": "rollup -c && cpy \"**/assets/**\" \"../dist/\" --parents --cwd=src",
|
|
91
|
+
"build:types": "tsc --outDir dist/node --declaration",
|
|
92
|
+
"build": "rimraf dist && pnpm run build:js && pnpm run build:types",
|
|
93
|
+
"coverage:merge": "rimraf tmp/coverage/{all,merge} && cp-flat \"tmp/coverage/*/json/**/*.json\" \"tmp/coverage/merge\" && nyc report -r lcov --report-dir tmp/coverage/all/lcov --temp-dir \"tmp/coverage/merge/\"",
|
|
94
|
+
"coverage:check": "pnpm run coverage:merge && nyc check-coverage --report-dir tmp/coverage/all/lcov --lines 50 --functions 50 --branches 50 --statements 50",
|
|
95
|
+
"test:mocha": "mocha ./src/**/*.test.*",
|
|
96
|
+
"test:mocha:coverage": "rimraf tmp/coverage/mocha && nyc --all mocha ./src/**/*.test.*",
|
|
97
|
+
"test:mocha:watch": "mocha --watch ./src/**/*.test.*",
|
|
98
|
+
"test:karma": "rimraf tmp/coverage/karma && karma start --single-run --log-level debug",
|
|
99
|
+
"test:mocha:ci": "rimraf tmp/coverage/mocha && nyc --all mocha ./{src,dist/node}/**/*.test.*",
|
|
100
|
+
"coveralls": "pnpm run coverage:check && nyc report --reporter=text-lcov --temp-dir \"tmp/coverage/merge/\" | coveralls"
|
|
98
101
|
}
|
|
99
|
-
}
|
|
102
|
+
}
|