Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
2b71ffe8c2 | |||
29ec99e63e | |||
50f1aad895 | |||
f7e95df2b9 | |||
a00536996c | |||
66f49cf8aa | |||
aa3f1eb21f | |||
d81a8006b1 | |||
5fa4c1cd85 | |||
fc609858ff | |||
19ecca0179 | |||
ff55e596cb | |||
ed8c8312c2 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,8 +15,6 @@ node_modules/
|
|||||||
|
|
||||||
# builds
|
# builds
|
||||||
dist/
|
dist/
|
||||||
dist_web/
|
dist_*/
|
||||||
dist_serve/
|
|
||||||
dist_ts_web/
|
|
||||||
|
|
||||||
# custom
|
# custom
|
@ -24,13 +24,14 @@ mirror:
|
|||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
snyk:
|
audit:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci command npm install -g snyk
|
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --ignore-scripts
|
||||||
- npmci command snyk test
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
|
29
.vscode/launch.json
vendored
Normal file
29
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "current file",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"args": [
|
||||||
|
"${relativeFile}"
|
||||||
|
],
|
||||||
|
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"protocol": "inspector",
|
||||||
|
"internalConsoleOptions": "openOnSessionStart"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "test.ts",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"args": [
|
||||||
|
"test/test.ts"
|
||||||
|
],
|
||||||
|
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"protocol": "inspector",
|
||||||
|
"internalConsoleOptions": "openOnSessionStart"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"json.schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": ["/npmextra.json"],
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"npmci": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for npmci"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for gitzone",
|
||||||
|
"properties": {
|
||||||
|
"projectType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["website", "element", "service", "npm"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -9,6 +9,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitzone": {
|
"gitzone": {
|
||||||
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "gitlab.com",
|
"githost": "gitlab.com",
|
||||||
"gitscope": "pushrocks",
|
"gitscope": "pushrocks",
|
||||||
|
48
package-lock.json
generated
48
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/tapbundle",
|
"name": "@pushrocks/tapbundle",
|
||||||
"version": "3.2.2",
|
"version": "3.2.8",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1145,9 +1145,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@gitzone/tstest": {
|
"@gitzone/tstest": {
|
||||||
"version": "1.0.35",
|
"version": "1.0.41",
|
||||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftstest/-/tstest-1.0.35.tgz",
|
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftstest/-/tstest-1.0.41.tgz",
|
||||||
"integrity": "sha512-Eij/Cgxs/YGDtQ0NSndp0sT97ugwcQGUt9y2QzWgntTb0IY+HTZCxLTD00Xn9m5CRevUO5sB4dyRp0GGDtC5wA==",
|
"integrity": "sha512-L9ERXbAC9F6b1um6KCt/kXc6xRcRUt0mZkujA8vRhnVLhFQZ9k3gk/ABD8tQNu1qnPlIH4hjJeVC/CJL/SYgsw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@gitzone/tsbundle": "^1.0.72",
|
"@gitzone/tsbundle": "^1.0.72",
|
||||||
@ -1323,7 +1323,6 @@
|
|||||||
"version": "4.0.10",
|
"version": "4.0.10",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartenv/-/smartenv-4.0.10.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartenv/-/smartenv-4.0.10.tgz",
|
||||||
"integrity": "sha512-b9jJbBSaOl0nlujyEu/0q5lkOFSMmfcOwPGb3pYrF1B37O15qmVpuqYwA5T8BXj8A6y+oA2bwrrtDzQ7hYp1zg==",
|
"integrity": "sha512-b9jJbBSaOl0nlujyEu/0q5lkOFSMmfcOwPGb3pYrF1B37O15qmVpuqYwA5T8BXj8A6y+oA2bwrrtDzQ7hYp1zg==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartparam": "^1.1.6",
|
"@pushrocks/smartparam": "^1.1.6",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
@ -1700,7 +1699,6 @@
|
|||||||
"version": "1.1.6",
|
"version": "1.1.6",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartparam/-/smartparam-1.1.6.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartparam/-/smartparam-1.1.6.tgz",
|
||||||
"integrity": "sha512-1El/F2QTWYDGy4Nh6vz9Ry1JVg1FEeyexB7Uvi4zHElpXYVxwso6xImRTLj+SW50JAg7nwEZ+ljkzTG9XvnwWA==",
|
"integrity": "sha512-1El/F2QTWYDGy4Nh6vz9Ry1JVg1FEeyexB7Uvi4zHElpXYVxwso6xImRTLj+SW50JAg7nwEZ+ljkzTG9XvnwWA==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"is-promise": "^2.1.0",
|
"is-promise": "^2.1.0",
|
||||||
@ -1839,9 +1837,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/webrequest": {
|
"@pushrocks/webrequest": {
|
||||||
"version": "2.0.9",
|
"version": "2.0.10",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fwebrequest/-/webrequest-2.0.9.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fwebrequest/-/webrequest-2.0.10.tgz",
|
||||||
"integrity": "sha512-cHKbVlS6j26SRzFMjvV+4hwwimXJ9NX/NnUmLmPSTZguzz6dEp1dYd+aNzGaGC8Da4ewvH7klhx7a5LI3Gv5tw==",
|
"integrity": "sha512-uQ8MvKclGqdLaUjah3SUsr8RplvtEUDXpFYjyO1dsHabbLWNVPQipt70CAMvS/8hOzDDD/G+dUEHIz2yZSVKNQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartdelay": "^2.0.9",
|
"@pushrocks/smartdelay": "^2.0.9",
|
||||||
@ -2106,10 +2104,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "14.0.19",
|
"version": "14.0.22",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.0.19.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.0.22.tgz",
|
||||||
"integrity": "sha512-yf3BP/NIXF37BjrK5klu//asUWitOEoUP5xE1mhSUjazotwJ/eJDgEmMQNlOeWOVv72j24QQ+3bqXHE++CFGag==",
|
"integrity": "sha512-emeGcJvdiZ4Z3ohbmw93E/64jRzUHAItSHt8nF7M4TGgQTiWqFVGB8KNpLGFmUHmHLvjvBgFwVlqNcq+VuGv9g=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"@types/parcel-bundler": {
|
"@types/parcel-bundler": {
|
||||||
"version": "1.12.1",
|
"version": "1.12.1",
|
||||||
@ -2616,8 +2613,7 @@
|
|||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/balanced-match/-/balanced-match-1.0.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"base": {
|
"base": {
|
||||||
"version": "0.11.2",
|
"version": "0.11.2",
|
||||||
@ -2786,7 +2782,6 @@
|
|||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"resolved": "https://verdaccio.lossless.one/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
"resolved": "https://verdaccio.lossless.one/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^1.0.0",
|
||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
@ -3435,8 +3430,7 @@
|
|||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": "https://verdaccio.lossless.one/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"concat-stream": {
|
"concat-stream": {
|
||||||
"version": "1.6.2",
|
"version": "1.6.2",
|
||||||
@ -6558,8 +6552,7 @@
|
|||||||
"is-promise": {
|
"is-promise": {
|
||||||
"version": "2.2.2",
|
"version": "2.2.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/is-promise/-/is-promise-2.2.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/is-promise/-/is-promise-2.2.2.tgz",
|
||||||
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==",
|
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"is-reference": {
|
"is-reference": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
@ -6679,9 +6672,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"js-base64": {
|
"js-base64": {
|
||||||
"version": "2.6.2",
|
"version": "2.6.3",
|
||||||
"resolved": "https://verdaccio.lossless.one/js-base64/-/js-base64-2.6.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/js-base64/-/js-base64-2.6.3.tgz",
|
||||||
"integrity": "sha512-1hgLrLIrmCgZG+ID3VoLNLOSwjGnoZa8tyrUdEteMeIzsT6PH7PMLyUvbDwzNE56P3PNxyvuIOx4Uh2E5rzQIw==",
|
"integrity": "sha512-fiUvdfCaAXoQTHdKMgTvg6IkecXDcVz6V5rlftUTclF9IKBjMizvSdQaCl/z/6TApDeby5NL+axYou3i0mu1Pg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"js-tokens": {
|
"js-tokens": {
|
||||||
@ -7245,7 +7238,6 @@
|
|||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://verdaccio.lossless.one/minimatch/-/minimatch-3.0.4.tgz",
|
"resolved": "https://verdaccio.lossless.one/minimatch/-/minimatch-3.0.4.tgz",
|
||||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
@ -8567,12 +8559,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public-ip": {
|
"public-ip": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/public-ip/-/public-ip-4.0.1.tgz",
|
"resolved": "https://verdaccio.lossless.one/public-ip/-/public-ip-4.0.2.tgz",
|
||||||
"integrity": "sha512-uy7G5RtP7MH9KILMX6cschB9aOxxRwFo0zv7Lf+ZXIw5IrH4EfdKQfACIwUEFilEHtkgJ9lpRfggwi1GVzN2vw==",
|
"integrity": "sha512-ZHqUjaYT/+FuSiy5/o2gBxvj0PF7M3MXGnaLJBsJNMCyXI4jzuXXHJKrk0gDxx1apiF/jYsBwjTQOM9V8G6oCQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"dns-socket": "^4.2.0",
|
"dns-socket": "^4.2.1",
|
||||||
"got": "^9.6.0",
|
"got": "^9.6.0",
|
||||||
"is-ip": "^3.1.0"
|
"is-ip": "^3.1.0"
|
||||||
}
|
}
|
||||||
|
19
package.json
19
package.json
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/tapbundle",
|
"name": "@pushrocks/tapbundle",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "3.2.2",
|
"version": "3.2.8",
|
||||||
"description": "tap bundled for tapbuffer",
|
"description": "tap bundled for tapbuffer",
|
||||||
"main": "dist/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
"build": "(tsbuild)"
|
"build": "(tsbuild --web)"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -21,6 +21,7 @@
|
|||||||
"homepage": "https://gitlab.com/pushrocks/tapbundle#README",
|
"homepage": "https://gitlab.com/pushrocks/tapbundle#README",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartdelay": "^2.0.9",
|
"@pushrocks/smartdelay": "^2.0.9",
|
||||||
|
"@pushrocks/smartenv": "^4.0.10",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@pushrocks/smarttime": "^3.0.19",
|
"@pushrocks/smarttime": "^3.0.19",
|
||||||
"smartchai": "^2.0.1"
|
"smartchai": "^2.0.1"
|
||||||
@ -28,8 +29,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.24",
|
"@gitzone/tsbuild": "^2.1.24",
|
||||||
"@gitzone/tsrun": "^1.2.12",
|
"@gitzone/tsrun": "^1.2.12",
|
||||||
"@gitzone/tstest": "^1.0.35",
|
"@gitzone/tstest": "^1.0.41",
|
||||||
"@types/node": "^14.0.19",
|
"@types/node": "^14.0.22",
|
||||||
"randomstring": "^1.1.5",
|
"randomstring": "^1.1.5",
|
||||||
"tslint": "^6.1.2",
|
"tslint": "^6.1.2",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
@ -38,11 +39,15 @@
|
|||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
"ts_web/**/*",
|
"ts_web/**/*",
|
||||||
"dist/**/*",
|
"dist/**/*",
|
||||||
"dist_web/**/*",
|
"dist_*/**/*",
|
||||||
|
"dist_ts/**/*",
|
||||||
"dist_ts_web/**/*",
|
"dist_ts_web/**/*",
|
||||||
"assets/**/*",
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -8,13 +8,20 @@ tap bundled for tapbuffer
|
|||||||
* [docs (typedoc)](https://pushrocks.gitlab.io/tapbundle/)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/tapbundle/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[](https://gitlab.com/pushrocks/tapbundle/commits/master)
|
|
||||||
[](https://gitlab.com/pushrocks/tapbundle/commits/master)
|
Status Category | Status Badge
|
||||||
[](https://www.npmjs.com/package/@pushrocks/tapbundle)
|
-- | --
|
||||||
[](https://snyk.io/test/npm/@pushrocks/tapbundle)
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
npm | [](https://lossless.cloud)
|
||||||
[](https://prettier.io/)
|
Snyk | [](https://lossless.cloud)
|
||||||
|
TypeScript Support | [](https://lossless.cloud)
|
||||||
|
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
Code Style | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||||
|
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||||
|
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -35,24 +42,24 @@ import { tap, expect } from 'tapbundle'; // has typings in place
|
|||||||
|
|
||||||
import * as myAwesomeModuleToTest from '../dist/index'; // '../dist/index' is the standard path for npmts modules
|
import * as myAwesomeModuleToTest from '../dist/index'; // '../dist/index' is the standard path for npmts modules
|
||||||
|
|
||||||
tap.test('my awesome description', async tools => {
|
tap.test('my awesome description', async (tools) => {
|
||||||
// tools are optional parameter
|
// tools are optional parameter
|
||||||
tools.timeout(2000); // test will fail if it takes longer than 2000 millisenconds
|
tools.timeout(2000); // test will fail if it takes longer than 2000 millisenconds
|
||||||
});
|
});
|
||||||
|
|
||||||
let myTest2 = tap.test('my awesome test 2', async tools => {
|
let myTest2 = tap.test('my awesome test 2', async (tools) => {
|
||||||
myAwsomeModuleToTest.doSomethingAsync(); // we don't wait here
|
myAwsomeModuleToTest.doSomethingAsync(); // we don't wait here
|
||||||
await tools.delayFor(3000); // yay! :) promise based timeouts :)
|
await tools.delayFor(3000); // yay! :) promise based timeouts :)
|
||||||
console.log('This gets logged 3000 ms into the test');
|
console.log('This gets logged 3000 ms into the test');
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('my awesome test 3', async tools => {
|
tap.test('my awesome test 3', async (tools) => {
|
||||||
expect(true).to.be.true; // will not throw
|
expect(true).to.be.true; // will not throw
|
||||||
await expect(tools.delayFor(2000)).to.eventually.be.fulfilled; // yay expect promises :)
|
await expect(tools.delayFor(2000)).to.eventually.be.fulfilled; // yay expect promises :)
|
||||||
expect((await myTest2.promise).hrtMeasurement.milliSeconds > 1000).to.be.true; // access other tests metadata :)
|
expect((await myTest2.promise).hrtMeasurement.milliSeconds > 1000).to.be.true; // access other tests metadata :)
|
||||||
});
|
});
|
||||||
|
|
||||||
let myTest4 = tap.testParallel('my awesome test 4', async tools => {
|
let myTest4 = tap.testParallel('my awesome test 4', async (tools) => {
|
||||||
await tools.delayFor(4000);
|
await tools.delayFor(4000);
|
||||||
console.log('logs to console after 4 seconds into this test');
|
console.log('logs to console after 4 seconds into this test');
|
||||||
});
|
});
|
@ -8,8 +8,8 @@ const test1 = tap.test('my first test -> expect true to be true', async () => {
|
|||||||
return expect(true).to.be.true;
|
return expect(true).to.be.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const test2 = tap.test('my second test', async tools => {
|
const test2 = tap.test('my second test', async (tools) => {
|
||||||
await tools.delayFor(1000);
|
await tools.delayFor(50);
|
||||||
});
|
});
|
||||||
|
|
||||||
const test3 = tap.test(
|
const test3 = tap.test(
|
||||||
@ -17,26 +17,24 @@ const test3 = tap.test(
|
|||||||
async () => {
|
async () => {
|
||||||
expect((await test1).hrtMeasurement.milliSeconds < (await test2).hrtMeasurement.milliSeconds).to
|
expect((await test1).hrtMeasurement.milliSeconds < (await test2).hrtMeasurement.milliSeconds).to
|
||||||
.be.true;
|
.be.true;
|
||||||
expect((await test2).hrtMeasurement.milliSeconds > 1000).to.be.true;
|
expect((await test2).hrtMeasurement.milliSeconds > 10).to.be.true;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const test4 = tap.skip.test('my 4th test -> should fail', async tools => {
|
const test4 = tap.skip.test('my 4th test -> should fail', async (tools) => {
|
||||||
tools.allowFailure();
|
tools.allowFailure();
|
||||||
expect(false).to.be.true;
|
expect(false).to.be.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const test5 = tap.test('my 5th test -> should pass in about 500ms', async tools => {
|
const test5 = tap.test('my 5th test -> should pass in about 500ms', async (tools) => {
|
||||||
tools.timeout(1000);
|
tools.timeout(1000);
|
||||||
await tools.delayFor(500);
|
await tools.delayFor(500);
|
||||||
});
|
});
|
||||||
|
|
||||||
const test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async tools => {
|
const test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async (tools) => {
|
||||||
tools.allowFailure();
|
tools.allowFailure();
|
||||||
tools.timeout(1000);
|
tools.timeout(1000);
|
||||||
await tools.delayFor(2000);
|
await tools.delayFor(100);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start().catch(err => {
|
tap.start();
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
import { tap, expect } from '../ts/index';
|
|
||||||
import * as randomstring from 'randomstring';
|
|
||||||
|
|
||||||
const test1 = tap.test('my first test -> expect true to be true', async tools => {
|
|
||||||
await tools.checkIterationLeak(async () => {
|
|
||||||
const domain = randomstring.generate(1000);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const outsideArray = [];
|
|
||||||
|
|
||||||
const test2 = tap.test('should throw', async tools => {
|
|
||||||
const err = await tools.returnError(async () => {
|
|
||||||
await tools.checkIterationLeak(async () => {
|
|
||||||
outsideArray.push(randomstring.generate(1000));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
expect(err).to.be.undefined;
|
|
||||||
});
|
|
||||||
|
|
||||||
tap.start();
|
|
@ -1,10 +1,5 @@
|
|||||||
import { tap, expect } from '../ts/index';
|
import { tap, expect, TapWrap } from '../ts/index';
|
||||||
|
|
||||||
const tapwrap = tap.wrap(async () => {
|
tap.test('should run a test', async () => {});
|
||||||
tap.test('should do something', async () => {
|
|
||||||
console.log('test1');
|
|
||||||
});
|
|
||||||
tap.start();
|
|
||||||
});
|
|
||||||
|
|
||||||
tapwrap.run();
|
tap.start();
|
||||||
|
10
test/test.ts
10
test/test.ts
@ -2,13 +2,13 @@ import { tap, expect } from '../ts/index';
|
|||||||
|
|
||||||
tap.preTask('hi there', async () => {
|
tap.preTask('hi there', async () => {
|
||||||
console.log('this is a pretask');
|
console.log('this is a pretask');
|
||||||
})
|
});
|
||||||
|
|
||||||
const test1 = tap.test('my first test -> expect true to be true', async () => {
|
const test1 = tap.test('my first test -> expect true to be true', async () => {
|
||||||
return expect(true).to.be.true;
|
return expect(true).to.be.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const test2 = tap.test('my second test', async tools => {
|
const test2 = tap.test('my second test', async (tools) => {
|
||||||
await tools.delayFor(1000);
|
await tools.delayFor(1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -21,17 +21,17 @@ const test3 = tap.test(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const test4 = tap.skip.test('my 4th test -> should fail', async tools => {
|
const test4 = tap.skip.test('my 4th test -> should fail', async (tools) => {
|
||||||
tools.allowFailure();
|
tools.allowFailure();
|
||||||
expect(false).to.be.true;
|
expect(false).to.be.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const test5 = tap.test('my 5th test -> should pass in about 500ms', async tools => {
|
const test5 = tap.test('my 5th test -> should pass in about 500ms', async (tools) => {
|
||||||
tools.timeout(1000);
|
tools.timeout(1000);
|
||||||
await tools.delayFor(500);
|
await tools.delayFor(500);
|
||||||
});
|
});
|
||||||
|
|
||||||
const test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async tools => {
|
const test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async (tools) => {
|
||||||
tools.allowFailure();
|
tools.allowFailure();
|
||||||
tools.timeout(1000);
|
tools.timeout(1000);
|
||||||
await tools.delayFor(2000);
|
await tools.delayFor(2000);
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
export { expect } from 'smartchai';
|
export { expect } from 'smartchai';
|
||||||
export { tap } from './tapbundle.classes.tap';
|
export { tap } from './tapbundle.classes.tap';
|
||||||
|
export { TapWrap } from './tapbundle.classes.tapwrap';
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import * as plugins from './tapbundle.plugins';
|
import * as plugins from './tapbundle.plugins';
|
||||||
import { TapTools } from './tapbundle.classes.taptools';
|
import { TapTools } from './tapbundle.classes.taptools';
|
||||||
|
|
||||||
|
|
||||||
export interface IPreTaskFunction {
|
export interface IPreTaskFunction {
|
||||||
(tapTools?: TapTools): Promise<any>;
|
(tapTools?: TapTools): Promise<any>;
|
||||||
}
|
}
|
||||||
@ -15,8 +14,8 @@ export class PreTask {
|
|||||||
this.preTaskFunction = preTaskFunctionArg;
|
this.preTaskFunction = preTaskFunctionArg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async run () {
|
public async run() {
|
||||||
console.log(`::__PRETASK: ${this.description}`);
|
console.log(`::__PRETASK: ${this.description}`);
|
||||||
await this.preTaskFunction(new TapTools(null));
|
await this.preTaskFunction(new TapTools(null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ import * as plugins from './tapbundle.plugins';
|
|||||||
|
|
||||||
import { IPreTaskFunction, PreTask } from './tapbundle.classes.pretask';
|
import { IPreTaskFunction, PreTask } from './tapbundle.classes.pretask';
|
||||||
import { TapTest, ITestFunction } from './tapbundle.classes.taptest';
|
import { TapTest, ITestFunction } from './tapbundle.classes.taptest';
|
||||||
import { TapWrap, ITapWrapFunction } from './tapbundle.classes.tapwrap';
|
|
||||||
export class Tap {
|
export class Tap {
|
||||||
/**
|
/**
|
||||||
* skips a test
|
* skips a test
|
||||||
@ -14,7 +13,7 @@ export class Tap {
|
|||||||
},
|
},
|
||||||
testParallel: (descriptionArg: string, functionArg: ITestFunction) => {
|
testParallel: (descriptionArg: string, functionArg: ITestFunction) => {
|
||||||
console.log(`skipped test: ${descriptionArg}`);
|
console.log(`skipped test: ${descriptionArg}`);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,7 +22,7 @@ export class Tap {
|
|||||||
public only = {
|
public only = {
|
||||||
test: (descriptionArg: string, testFunctionArg: ITestFunction) => {
|
test: (descriptionArg: string, testFunctionArg: ITestFunction) => {
|
||||||
this.test(descriptionArg, testFunctionArg, 'only');
|
this.test(descriptionArg, testFunctionArg, 'only');
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
private _tapPreTasks: PreTask[] = [];
|
private _tapPreTasks: PreTask[] = [];
|
||||||
@ -43,7 +42,7 @@ export class Tap {
|
|||||||
const localTest = new TapTest({
|
const localTest = new TapTest({
|
||||||
description: testDescription,
|
description: testDescription,
|
||||||
testFunction,
|
testFunction,
|
||||||
parallel: false
|
parallel: false,
|
||||||
});
|
});
|
||||||
if (modeArg === 'normal') {
|
if (modeArg === 'normal') {
|
||||||
this._tapTests.push(localTest);
|
this._tapTests.push(localTest);
|
||||||
@ -53,17 +52,10 @@ export class Tap {
|
|||||||
return localTest;
|
return localTest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public preTask (descriptionArg: string, functionArg: IPreTaskFunction) {
|
public preTask(descriptionArg: string, functionArg: IPreTaskFunction) {
|
||||||
this._tapPreTasks.push(new PreTask(descriptionArg, functionArg));
|
this._tapPreTasks.push(new PreTask(descriptionArg, functionArg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* wraps function
|
|
||||||
*/
|
|
||||||
public wrap(functionArg: ITapWrapFunction) {
|
|
||||||
return new TapWrap(functionArg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A parallel test that will not be waited for before the next starts.
|
* A parallel test that will not be waited for before the next starts.
|
||||||
* @param testDescription - A description of what the test does
|
* @param testDescription - A description of what the test does
|
||||||
@ -74,7 +66,7 @@ export class Tap {
|
|||||||
new TapTest({
|
new TapTest({
|
||||||
description: testDescription,
|
description: testDescription,
|
||||||
testFunction,
|
testFunction,
|
||||||
parallel: true
|
parallel: true,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -83,6 +75,13 @@ export class Tap {
|
|||||||
* starts the test evaluation
|
* starts the test evaluation
|
||||||
*/
|
*/
|
||||||
public async start(optionsArg?: { throwOnError: boolean }) {
|
public async start(optionsArg?: { throwOnError: boolean }) {
|
||||||
|
// lets set the tapbundle promise
|
||||||
|
const smartenvInstance = new plugins.smartenv.Smartenv();
|
||||||
|
smartenvInstance.isBrowser
|
||||||
|
? (globalThis.tapbundleDeferred = plugins.smartpromise.defer())
|
||||||
|
: null;
|
||||||
|
|
||||||
|
// lets continue with running the tests
|
||||||
const promiseArray: Array<Promise<any>> = [];
|
const promiseArray: Array<Promise<any>> = [];
|
||||||
|
|
||||||
// safeguard against empty test array
|
// safeguard against empty test array
|
||||||
@ -137,7 +136,10 @@ export class Tap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (optionsArg && optionsArg.throwOnError && failReasons.length > 0) {
|
if (optionsArg && optionsArg.throwOnError && failReasons.length > 0) {
|
||||||
process.exit(1);
|
if (!smartenvInstance.isBrowser) process.exit(1);
|
||||||
|
}
|
||||||
|
if (smartenvInstance.isBrowser) {
|
||||||
|
globalThis.tapbundleDeferred.resolve();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@ export class TapTest {
|
|||||||
this.testKey = testKeyArg;
|
this.testKey = testKeyArg;
|
||||||
const testNumber = testKeyArg + 1;
|
const testNumber = testKeyArg + 1;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
await this.testFunction(this.tapTools);
|
await this.testFunction(this.tapTools);
|
||||||
if (this.status === 'timeout') {
|
if (this.status === 'timeout') {
|
||||||
throw new Error('Test succeeded, but timed out...');
|
throw new Error('Test succeeded, but timed out...');
|
||||||
|
@ -42,10 +42,6 @@ export class TapTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async checkIterationLeak(iterationfuncArg: IPromiseFunc) {
|
|
||||||
console.log('iteration leakage checks disabled for now due to incompatibilities with node v12');
|
|
||||||
}
|
|
||||||
|
|
||||||
public async returnError(throwingFuncArg: IPromiseFunc) {
|
public async returnError(throwingFuncArg: IPromiseFunc) {
|
||||||
let funcErr: Error;
|
let funcErr: Error;
|
||||||
try {
|
try {
|
||||||
|
@ -1,25 +1,13 @@
|
|||||||
import * as plugins from './tapbundle.plugins';
|
import * as plugins from './tapbundle.plugins';
|
||||||
|
|
||||||
export interface ITapWrapFunction {
|
export interface ITapWrapOptions {
|
||||||
(): Promise<any>;
|
before: () => Promise<any>;
|
||||||
|
after: () => {};
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TapWrap {
|
export class TapWrap {
|
||||||
wrapFunction: ITapWrapFunction;
|
public options: ITapWrapOptions;
|
||||||
|
constructor(optionsArg: ITapWrapOptions) {
|
||||||
/**
|
this.options = optionsArg;
|
||||||
* the constructor
|
|
||||||
*/
|
|
||||||
constructor(wrapFunctionArg: ITapWrapFunction) {
|
|
||||||
// nothing here
|
|
||||||
this.wrapFunction = wrapFunctionArg;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* run the wrapFunction
|
|
||||||
*/
|
|
||||||
async run() {
|
|
||||||
// TODO: make sure it makes sense what we do here.
|
|
||||||
await this.wrapFunction();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// pushrocks
|
// pushrocks
|
||||||
import * as smartdelay from '@pushrocks/smartdelay';
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
|
import * as smartenv from '@pushrocks/smartenv';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
|
|
||||||
export { smartdelay, smartpromise };
|
export { smartdelay, smartenv, smartpromise };
|
||||||
|
|
||||||
// third party
|
// third party
|
||||||
/* import * as leakage from 'leakage';
|
/* import * as leakage from 'leakage';
|
||||||
|
Reference in New Issue
Block a user