Compare commits

...

165 Commits

Author SHA1 Message Date
01823fb683 5.4.0 2024-11-06 02:46:35 +01:00
649e69e1f2 feat(node): Add smartmongo and smarts3 integration in node tools 2024-11-06 02:46:34 +01:00
05a361046e 5.3.0 2024-09-19 10:30:15 +02:00
a551989f8b feat(TapNodeTools): Add getEnvVarOnDemand method to TapNodeTools 2024-09-19 10:30:14 +02:00
7f765c08e4 5.2.2 2024-09-19 09:10:29 +02:00
4e7b5a693d fix(core): Ensure reliability in test setup and execution 2024-09-19 09:10:29 +02:00
20e36fbdf2 5.2.1 2024-09-19 08:38:38 +02:00
a61d87a9a0 fix(tapbundle): Add qenv package to dependencies for environment management 2024-09-19 08:38:38 +02:00
953957cae3 5.2.0 2024-09-18 18:43:46 +02:00
c712a9a09c feat(TapNodeTools): Add ability to create HTTPS certificates with self-signed option 2024-09-18 18:43:46 +02:00
5a94f116e1 5.1.4 2024-09-18 17:56:54 +02:00
0e80700481 fix(ts_node): Fixed issues in HTTPS certificate generation for TapNodeTools 2024-09-18 17:56:53 +02:00
22ec504b0f 5.1.3 2024-09-18 15:30:47 +02:00
3d39f65ed0 fix(ts_node/classes.tapnodetools.ts): Refactored methods and improved type annotations in TapNodeTools class. 2024-09-18 15:30:47 +02:00
7c450876f2 5.1.2 2024-09-18 00:46:53 +02:00
d7c3752dfa fix(TapNodeTools): Default parameter added to createHttpsCert method 2024-09-18 00:46:52 +02:00
f53e5bcc83 5.1.1 2024-09-18 00:45:51 +02:00
d8301314a7 fix(ts_node): Fixed createHttpsCert interface 2024-09-18 00:45:50 +02:00
155b0b9f91 5.1.0 2024-09-18 00:41:14 +02:00
61c493ce72 feat(ts_node): Add support for HTTPS certificate creation 2024-09-18 00:41:14 +02:00
4358e1d64d 5.0.25 2024-09-17 19:40:01 +02:00
1e6296f980 fix(core): Fix typos in package.json, update dependencies and update workflow. 2024-09-17 19:40:00 +02:00
0be2243ced 5.0.24 2024-08-17 07:30:12 +02:00
b6c0d8013b fix(dependencies): Update dependencies 2024-08-17 07:30:11 +02:00
54815c49d6 update description 2024-05-29 14:17:23 +02:00
104413c37f 5.0.23 2024-04-15 18:51:23 +02:00
68afa0bbdf fix(core): update 2024-04-15 18:51:22 +02:00
90f618eeff update tsconfig 2024-04-14 18:36:42 +02:00
4c6fb95ec9 update tsconfig 2024-04-01 21:42:25 +02:00
38ddb7be1f update npmextra.json: githost 2024-04-01 20:00:09 +02:00
4489be479e update npmextra.json: githost 2024-03-30 21:49:10 +01:00
7cd2993be0 5.0.22 2024-03-19 19:39:55 +01:00
36d4462504 fix(core): update 2024-03-19 19:39:54 +01:00
16c7ce2394 5.0.21 2024-03-19 13:51:10 +01:00
fd1a14524f fix(core): update 2024-03-19 13:51:10 +01:00
c97215ed2d 5.0.20 2024-03-19 13:43:34 +01:00
6dbe5098de fix(core): update 2024-03-19 13:43:34 +01:00
3e9a288333 5.0.19 2024-03-19 13:34:57 +01:00
07b876ea2c fix(core): update 2024-03-19 13:34:56 +01:00
28fec7a488 5.0.18 2024-03-19 13:13:57 +01:00
b99ac03942 fix(core): update 2024-03-19 13:13:56 +01:00
ba6519adb5 5.0.17 2024-03-13 22:13:31 +01:00
2de0e63b3c fix(core): update 2024-03-13 22:13:30 +01:00
2359841a15 5.0.16 2024-03-13 22:07:58 +01:00
0ef865ea9f fix(core): update 2024-03-13 22:07:58 +01:00
a8beda7597 5.0.15 2023-08-12 11:40:29 +02:00
e029c8601f fix(core): update 2023-08-12 11:40:29 +02:00
1b9f414e82 5.0.14 2023-08-12 11:39:09 +02:00
1aa4152de2 fix(core): update 2023-08-12 11:39:09 +02:00
b93e962bdf 5.0.13 2023-07-13 03:18:09 +02:00
0faf2ce3df fix(core): update 2023-07-13 03:18:08 +02:00
831f67053e 5.0.12 2023-07-13 02:41:11 +02:00
26e63372f8 fix(core): update 2023-07-13 02:41:10 +02:00
929a67585f 5.0.11 2023-07-13 02:40:10 +02:00
fb8d291441 fix(core): update 2023-07-13 02:40:09 +02:00
5657b49a51 5.0.10 2023-07-13 02:39:42 +02:00
db39da1faf fix(core): update 2023-07-13 02:39:42 +02:00
e9d6e9f9dd 5.0.9 2023-07-13 02:09:54 +02:00
d8e638a07f fix(core): update 2023-07-13 02:09:53 +02:00
85eb222bd9 5.0.8 2023-06-22 13:35:35 +02:00
189c0bae30 fix(core): update 2023-06-22 13:35:35 +02:00
570422ae61 5.0.7 2023-06-22 13:32:44 +02:00
4ba34a4b88 fix(core): update 2023-06-22 13:32:43 +02:00
ae2aabaa86 5.0.6 2022-07-24 15:22:10 +02:00
269a8c974e fix(core): update 2022-07-24 15:22:10 +02:00
10ab777e7f 5.0.5 2022-07-24 14:03:45 +02:00
898eed4584 fix(core): update 2022-07-24 14:03:44 +02:00
7a1eae2bfb 5.0.4 2022-07-24 14:03:30 +02:00
8f7167f201 fix(core): update 2022-07-24 14:03:29 +02:00
6fa151f933 5.0.3 2022-03-24 13:17:20 +01:00
f846b91378 fix(core): update 2022-03-24 13:17:20 +01:00
a0840ee9f4 5.0.2 2022-03-14 13:17:55 +01:00
041534f363 fix(core): update 2022-03-14 13:17:54 +01:00
c89362ba8a 5.0.1 2022-03-14 12:56:17 +01:00
f07879d2c1 fix(core): update 2022-03-14 12:56:17 +01:00
eba3a19488 5.0.0 2022-03-14 11:23:02 +01:00
f83479a407 4.0.9 2022-03-14 11:22:18 +01:00
da711c119f fix(core): update 2022-03-14 11:22:17 +01:00
6690238251 4.0.8 2022-02-28 13:17:00 +01:00
27a794b83c fix(core): update 2022-02-28 13:16:59 +01:00
b3c4a58491 4.0.7 2022-02-15 16:49:29 +01:00
50c34f89ee fix(core): update 2022-02-15 16:49:29 +01:00
b813453c5f 4.0.6 2022-02-15 16:48:59 +01:00
9a6dc33b6b fix(core): update 2022-02-15 16:48:59 +01:00
8bf99ae7ec 4.0.5 2022-02-15 16:48:04 +01:00
cc708b29ae fix(core): update 2022-02-15 16:48:03 +01:00
5798d3e808 4.0.4 2022-02-15 16:40:22 +01:00
37fe299a45 fix(core): update 2022-02-15 16:40:21 +01:00
e24cdd9f0f 4.0.3 2022-02-02 08:11:01 +01:00
ae7aaab456 fix(core): update 2022-02-02 08:11:00 +01:00
bab360cc59 4.0.2 2022-02-02 07:38:27 +01:00
36dcd228fd fix(core): update 2022-02-02 07:38:26 +01:00
c7d6451758 4.0.1 2022-02-02 03:03:03 +01:00
aeedf14336 fix(core): update 2022-02-02 03:03:03 +01:00
14b95cfbc3 4.0.0 2022-01-21 19:54:08 +01:00
0884da7941 BREAKING CHANGE(core): switxh to @pushrocks/smartexpect 2022-01-21 19:54:07 +01:00
22df58b8bc 3.2.15 2021-12-10 17:34:06 +01:00
33399126f7 fix(core): update 2021-12-10 17:34:06 +01:00
d1e46fd2a7 3.2.14 2021-02-13 16:06:38 +00:00
9304e6d736 fix(core): update 2021-02-13 16:06:38 +00:00
588c532d6d 3.2.13 2021-02-13 16:02:40 +00:00
e3a756c775 fix(core): update 2021-02-13 16:02:40 +00:00
05defe6031 3.2.12 2021-01-26 03:19:50 +00:00
f4bb17dea1 fix(core): update 2021-01-26 03:19:49 +00:00
1023a94ff2 3.2.11 2021-01-26 03:15:50 +00:00
8ee456da5f fix(core): update 2021-01-26 03:15:50 +00:00
45ee6eca31 3.2.10 2021-01-26 02:35:03 +00:00
1eaf1e9a77 fix(core): update 2021-01-26 02:35:02 +00:00
715108b11b 3.2.9 2020-07-11 16:07:53 +00:00
7b1e8f47b1 fix(core): update 2020-07-11 16:07:52 +00:00
2b71ffe8c2 3.2.8 2020-07-11 16:07:31 +00:00
29ec99e63e fix(core): update 2020-07-11 16:07:30 +00:00
50f1aad895 3.2.7 2020-07-08 00:46:44 +00:00
f7e95df2b9 fix(core): update 2020-07-08 00:46:43 +00:00
a00536996c 3.2.6 2020-07-08 00:17:32 +00:00
66f49cf8aa fix(core): update 2020-07-08 00:17:31 +00:00
aa3f1eb21f update readme 2020-07-08 00:17:25 +00:00
d81a8006b1 3.2.5 2020-07-08 00:16:10 +00:00
5fa4c1cd85 fix(core): update 2020-07-08 00:16:09 +00:00
fc609858ff 3.2.4 2020-07-08 00:15:45 +00:00
19ecca0179 fix(core): update 2020-07-08 00:15:44 +00:00
ff55e596cb 3.2.3 2020-07-08 00:11:16 +00:00
ed8c8312c2 fix(core): update 2020-07-08 00:11:16 +00:00
a6dd8de0db 3.2.2 2020-07-07 22:54:15 +00:00
081347b23b fix(core): update 2020-07-07 22:54:15 +00:00
f23575a8a2 3.2.1 2020-03-15 16:36:26 +00:00
b2dbc9160b fix(core): update 2020-03-15 16:36:25 +00:00
1e8ab2d7a2 3.2.0 2019-11-16 23:40:38 +01:00
427878763e feat(pretask): introduce new pretask functionality for setting up testing environment 2019-11-16 23:40:36 +01:00
bdcc94e723 3.1.0 2019-11-16 19:22:21 +01:00
3ac46b2363 feat(tools): can now ensure certain directories 2019-11-16 19:22:20 +01:00
deae532820 3.0.14 2019-11-16 18:45:48 +01:00
99883eab82 fix(core): update 2019-11-16 18:45:47 +01:00
e27e59bbeb 3.0.13 2019-08-23 00:05:22 +02:00
fa54431280 fix(core): update 2019-08-23 00:05:21 +02:00
aa7c49548c 3.0.12 2019-08-22 23:57:28 +02:00
8d5352d000 fix(core): update 2019-08-22 23:57:27 +02:00
c3ae0bc211 3.0.11 2019-06-19 14:49:24 +02:00
0381f63b65 fix(core): update 2019-06-19 14:49:23 +02:00
f1441bf123 3.0.10 2019-06-19 13:18:46 +02:00
9892085140 fix(core): update 2019-06-19 13:18:45 +02:00
b6d1c3c083 3.0.9 2019-04-10 12:56:56 +02:00
6e6cfbadbd fix(core): update 2019-04-10 12:56:55 +02:00
02ff220c59 3.0.8 2019-04-10 12:56:18 +02:00
035cb84442 fix(core): update 2019-04-10 12:56:17 +02:00
505f624dd9 3.0.7 2018-09-03 00:01:53 +02:00
ea5fbd4637 fix(dependencies): update to latest versions 2018-09-03 00:01:53 +02:00
de780538a5 3.0.6 2018-09-02 23:54:59 +02:00
28b1f0bfed fix(core): add tap.only option 2018-09-02 23:54:59 +02:00
72b72a9ffb 3.0.5 2018-08-08 23:38:43 +02:00
be393199be fix(dependencies): update 2018-08-08 23:38:43 +02:00
7b6260bb15 3.0.4 2018-08-08 23:20:14 +02:00
2345e972d5 fix(dependencies): use @gitzone/tsbuild instead of npmts 2018-08-08 23:20:14 +02:00
22c44a8cd0 3.0.3 2018-08-08 23:17:06 +02:00
bae2aebf83 fix(dependencies): now typings-global free 2018-08-08 23:17:06 +02:00
5fe2358bfe 3.0.2 2018-07-18 08:31:22 +02:00
280ded573d fix(dependencies): update 2018-07-18 08:31:22 +02:00
6b6a92b709 3.0.1 2018-07-13 22:28:18 +02:00
c1589c2309 fix(package): npm access level 2018-07-13 22:28:17 +02:00
271d657f2c 3.0.0 2018-07-13 22:06:45 +02:00
63669ea6ff BREAKING CHANGE(package): change scope 2018-07-13 22:06:45 +02:00
4306272f45 2.0.2 2018-06-28 23:47:58 +02:00
4378b36069 fix(security): add snyk file 2018-06-28 23:47:57 +02:00
e8f7013435 2.0.1 2018-06-28 23:34:41 +02:00
3199943b59 fix(core): fix node 10.x.x compatibility 2018-06-28 23:34:41 +02:00
54 changed files with 9120 additions and 1659 deletions

View File

@ -0,0 +1,66 @@
name: Default (not tags)
on:
push:
tags-ignore:
- '**'
env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Install pnpm and npmci
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
- name: Run npm prepare
run: npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build

View File

@ -0,0 +1,124 @@
name: Default (tags)
on:
push:
tags:
- '*'
env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build
release:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Release
run: |
npmci node install stable
npmci npm publish
metadata:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Code quality
run: |
npmci command npm install -g typescript
npmci npm install
- name: Trigger
run: npmci trigger
- name: Build docs and upload artifacts
run: |
npmci node install stable
npmci npm install
pnpm install -g @git.zone/tsdoc
npmci command tsdoc
continue-on-error: true

18
.gitignore vendored
View File

@ -1,4 +1,20 @@
node_modules/ .nogit/
# artifacts
coverage/ coverage/
public/ public/
pages/ pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_*/
# custom

View File

@ -1,86 +0,0 @@
# gitzone standard
image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
key: "$CI_BUILD_STAGE"
stages:
- mirror
- test
- release
- trigger
- pages
mirror:
stage: mirror
script:
- npmci git mirror
tags:
- docker
testLEGACY:
stage: test
script:
- npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
allow_failure: true
testLTS:
stage: test
script:
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testSTABLE:
stage: test
script:
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci npm prepare
- npmci npm publish
only:
- tags
tags:
- docker
trigger:
stage: trigger
script:
- npmci trigger
only:
- tags
tags:
- docker
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
script:
- npmci command yarn global add npmpage
- npmci command npmpage
tags:
- docker
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public

11
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"type": "node-terminal"
}
]
}

26
.vscode/settings.json vendored Normal file
View 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", "wcc"]
}
}
}
}
}
}
]
}

View File

@ -1,26 +0,0 @@
# tapbundle
tap bundled for tapbuffer
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/tapbundle)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/tapbundle)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/tapbundle)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/tapbundle/)
## Status for master
[![build status](https://GitLab.com/pushrocks/tapbundle/badges/master/build.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master)
[![coverage report](https://GitLab.com/pushrocks/tapbundle/badges/master/coverage.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/tapbundle.svg)](https://www.npmjs.com/package/tapbundle)
[![Dependency Status](https://david-dm.org/pushrocks/tapbundle.svg)](https://david-dm.org/pushrocks/tapbundle)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/tapbundle/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/tapbundle/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/tapbundle/badges/code.svg)](https://www.bithound.io/github/pushrocks/tapbundle)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

225
changelog.md Normal file
View File

@ -0,0 +1,225 @@
# Changelog
## 2024-11-06 - 5.4.0 - feat(node)
Add smartmongo and smarts3 integration in node tools
- Added createSmartmongo method to TapNodeTools for creating SmartMongo instances.
- Added createSmarts3 method to TapNodeTools for creating Smarts3 instances.
- Updated dependencies with smartmongo and smarts3 in package.json.
## 2024-09-19 - 5.3.0 - feat(TapNodeTools)
Add getEnvVarOnDemand method to TapNodeTools
- Introduced a new method getEnvVarOnDemand to the TapNodeTools class to fetch environment variables on demand.
- Enhanced getQenv function in TapNodeTools class to cache the Qenv instance for better performance.
## 2024-09-19 - 5.2.2 - fix(core)
Ensure reliability in test setup and execution
- Added new pre-task functionality to log starting of tasks.
- Enhanced `runCommand` method to better handle shell command execution.
- Fixed issue in `createHttpsCert` to correctly generate self-signed certificates.
## 2024-09-19 - 5.2.1 - fix(tapbundle)
Add qenv package to dependencies for environment management
- Added @push.rocks/qenv to dependencies in package.json.
- Updated TapNodeTools class in ts_node/classes.tapnodetools.ts to include getQenv method.
- Imported qenv in ts_node/plugins.ts.
## 2024-09-18 - 5.2.0 - feat(TapNodeTools)
Add ability to create HTTPS certificates with self-signed option
- Introduced a new parameter `allowSelfSigned` to the `createHttpsCert` function.
## 2024-09-18 - 5.1.4 - fix(ts_node)
Fixed issues in HTTPS certificate generation for TapNodeTools
- Updated 'createHttpsCert' method in 'TapNodeTools' to use 'smartcrypto' for generating RSA key pair and self-signed certificate.
- Corrected certificate and private key PEM encoding.
## 2024-09-18 - 5.1.3 - fix(ts_node/classes.tapnodetools.ts)
Refactored methods and improved type annotations in TapNodeTools class.
- Refactored `runCommand` method to include proper type annotations.
- Enhanced `createHttpsCert` method with proper type annotations and key generation logic.
- Introduced `generateSelfSignedCert` method for better code organization and readability.
## 2024-09-18 - 5.1.2 - fix(TapNodeTools)
Default parameter added to createHttpsCert method
- Updated createHttpsCert method to provide a default value for the parameter commonName.
## 2024-09-18 - 5.1.1 - fix(ts_node)
Fixed createHttpsCert interface
- Removed unnecessary keyFile and certFile parameters from createHttpsCert method.
## 2024-09-18 - 5.1.0 - feat(ts_node)
Add support for HTTPS certificate creation
- Added TapNodeTools class with methods to run commands and create HTTPS certificates
- Exported necessary plugins including crypto and fs for node
- Updated test cases to include tests for HTTPS certificate creation
## 2024-09-17 - 5.0.25 - fix(core)
Fix typos in package.json, update dependencies and update workflow.
- Fixed references to deprecated package names in workflows and package.json.
- Updated versions of @push.rocks dependencies to latest stable.
- Corrected scripts in package.json to reflect new build and documentation commands.
- Fixed async startup in browser tests.
## 2024-08-17 - 5.0.24 - fix(dependencies)
Update dependencies
- Updated @push.rocks/smartexpect from ^1.0.21 to ^1.1.0
- Updated @push.rocks/smartjson from ^5.0.16 to ^5.0.20
- Updated @push.rocks/smartpromise from ^4.0.2 to ^4.0.4
- Updated @push.rocks/smarttime from ^4.0.6 to ^4.0.8
- Updated @types/node from ^20.11.30 to ^22.4.0
## 2024-05-29 - 5.0.23 - General Update
update description
## 2024-04-14 to 2024-04-15 - 5.0.22 - Configuration Updates and Bug Fixes
Multiple updates in tsconfig and npmextra.json
- fix(core): update
- update tsconfig
- update npmextra.json: githost
## 2024-03-19 - 5.0.21 to 5.0.17 - Bug Fix Release
Multiple core fixes and updates without specific feature changes
- fix(core): update
## 2024-03-13 - 5.0.16 - Bug Fix Release
- fix(core): update
## 2023-08-12 - 5.0.15 to 5.0.13 - Bug Fix Release
Multiple core fixes and updates without specific feature changes
- fix(core): update
## 2023-07-13 - 5.0.12 to 5.0.10 - Bug Fix Release
Multiple core fixes and updates without specific feature changes
- fix(core): update
## 2023-06-22 - 5.0.9 to 5.0.7 - Bug Fix Release
Multiple core fixes and updates without specific feature changes
- fix(core): update
## 2022-07-24 - 5.0.6 to 5.0.3 - Bug Fix Release
Multiple core fixes and updates without specific feature changes
- fix(core): update
## 2022-03-14 - 5.0.2 to 5.0.0 - Initial Release of Version 5.x.x
Multiple bug fixes and updates.
- fix(core): update
## 2022-03-14 - 4.0.9 to 4.0.8 - Bug Fix Release
- fix(core): update
## 2022-02-28 - 4.0.7 to 4.0.4 - Bug Fix Release
Multiple core fixes and updates without specific feature changes
- fix(core): update
## 2022-02-02 - 4.0.3 to 4.0.1 - Bug Fix Release
- fix(core): update
## 2022-01-21 - 4.0.0 - Major Release
Version 4.x.x Major improvements and core fixes
## 2021-12-10 - 3.2.15 - Breaking Change
BREAKING CHANGE(core): switch to @pushrocks/smartexpect
## 2021-12-10 - 3.2.14 - Bug Fix Release
- fix(core): update
## 2021-02-13 - 3.2.13 - Bug Fix Release
- fix(core): update
## 2021-01-26 - 3.2.12 to 3.2.11 - Bug Fix Release
- fix(core): update
## 2020-07-11 - 3.2.10 to 3.2.8 - Bug Fix Release
- fix(core): update
## 2020-07-08 - 3.2.7 to 3.2.4 - Bug Fix Release
Multiple core fixes and updates without specific feature changes
- fix(core): update
## 2020-07-08 - 3.2.5 - Documentation Update
- update readme
## 2019-11-16 - 3.1.0 - New Feature
- feat(pretask): introduce new pretask functionality for setting up testing environment
## 2019-11-16 - 3.0.14 - New Feature
- feat(tools): can now ensure certain directories
## 2019-08-23 - 3.0.13 - Bug Fix Release
- fix(core): update
## 2019-08-22 - 3.0.12 - Bug Fix Release
- fix(core): update
## 2019-06-19 - 3.0.11 - Bug Fix Release
- fix(core): update
## 2019-04-10 - 3.0.9 to 3.0.8 - Bug Fix Release
- fix(core): update
## 2018-09-03 - 3.0.7 - Bug Fix Release
- fix(core): update
## 2018-09-02 - 3.0.6 - Dependency Update
- fix(dependencies): update to latest versions
## 2018-08-08 - 3.0.5 - New Feature
- fix(core): add tap.only option
## 2018-08-08 - 3.0.4 - Dependency Update
- fix(dependencies): update
## 2018-08-08 - 3.0.3 - Dependency Update
- fix(dependencies): use @git.zone/tsbuild instead of npmts
## 2018-07-18 - 3.0.2 - Dependency Update
- fix(dependencies): now typings-global free
## 2018-07-13 - 3.0.1 - Dependency Update
- fix(dependencies): update
## 2018-07-13 - 3.0.0 - Package Update
- fix(package): npm access level
## 2018-06-28 - 2.0.2 - Breaking Change
BREAKING CHANGE(package): change scope
## 2018-06-28 - 2.0.1 - Security Update
- fix(security): add snyk file
## 2018-02-27 - 2.0.0 - Compatibility Update
- fix(core): fix node 10.x.x compatibility
## 2017-10-11 - 1.1.8 - Update
- update to use latest smartchai
## 2017-10-11 - 1.1.7 - Update
- update ci
## 2017-10-10 - 1.1.6 - Documentation Update
- add new docs
## 2017-10-09 - 1.1.5 - Feature Update
- now has working leak detection
## 2017-03-26 - 1.0.9 - Standards Update
- update to latest standards

2
dist/index.d.ts vendored
View File

@ -1,2 +0,0 @@
export { expect } from 'smartchai';
export { tap } from './tapbundle.classes.tap';

7
dist/index.js vendored
View File

@ -1,7 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var smartchai_1 = require("smartchai");
exports.expect = smartchai_1.expect;
var tapbundle_classes_tap_1 = require("./tapbundle.classes.tap");
exports.tap = tapbundle_classes_tap_1.tap;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHVDQUFrQztBQUF6Qiw2QkFBQSxNQUFNLENBQUE7QUFDZixpRUFBNkM7QUFBcEMsc0NBQUEsR0FBRyxDQUFBIn0=

View File

@ -1,38 +0,0 @@
import { TapTest, ITestFunction } from './tapbundle.classes.taptest';
import { TapWrap, ITapWrapFunction } from './tapbundle.classes.tapwrap';
export declare class Tap {
/**
* skip a test
*/
skip: {
test: (descriptionArg: string, functionArg: ITestFunction) => void;
};
private _tapTests;
/**
* Normal test function, will run one by one
* @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects
*/
test(testDescription: string, testFunction: ITestFunction): Promise<TapTest>;
/**
* wraps function
*/
wrap(functionArg: ITapWrapFunction): TapWrap;
/**
* A parallel test that will not be waited for before the next starts.
* @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects
*/
testParallel(testDescription: string, testFunction: ITestFunction): void;
/**
* starts the test evaluation
*/
start(optionsArg?: {
throwOnError: boolean;
}): Promise<void>;
/**
* handle errors
*/
threw(err: any): void;
}
export declare let tap: Tap;

View File

@ -1,111 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const tapbundle_classes_taptest_1 = require("./tapbundle.classes.taptest");
const tapbundle_classes_tapwrap_1 = require("./tapbundle.classes.tapwrap");
class Tap {
constructor() {
/**
* skip a test
*/
this.skip = {
test: (descriptionArg, functionArg) => {
console.log(`skipped test: ${descriptionArg}`);
}
};
this._tapTests = [];
}
/**
* Normal test function, will run one by one
* @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects
*/
test(testDescription, testFunction) {
return __awaiter(this, void 0, void 0, function* () {
let localTest = new tapbundle_classes_taptest_1.TapTest({
description: testDescription,
testFunction: testFunction,
parallel: false
});
this._tapTests.push(localTest);
return localTest;
});
}
/**
* wraps function
*/
wrap(functionArg) {
return new tapbundle_classes_tapwrap_1.TapWrap(functionArg);
}
/**
* A parallel test that will not be waited for before the next starts.
* @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects
*/
testParallel(testDescription, testFunction) {
this._tapTests.push(new tapbundle_classes_taptest_1.TapTest({
description: testDescription,
testFunction: testFunction,
parallel: true
}));
}
/**
* starts the test evaluation
*/
start(optionsArg) {
return __awaiter(this, void 0, void 0, function* () {
let promiseArray = [];
// safeguard against empty test array
if (this._tapTests.length === 0) {
console.log('no tests specified. Ending here!');
return;
}
console.log(`1..${this._tapTests.length}`);
for (let testKey = 0; testKey < this._tapTests.length; testKey++) {
let currentTest = this._tapTests[testKey];
let testPromise = currentTest.run(testKey);
if (currentTest.parallel) {
promiseArray.push(testPromise);
}
else {
yield testPromise;
}
}
yield Promise.all(promiseArray);
// when tests have been run and all promises are fullfilled
let failReasons = [];
let executionNotes = [];
// collect failed tests
for (let tapTest of this._tapTests) {
if (tapTest.status !== 'success') {
failReasons.push(`Test ${tapTest.testKey + 1} failed with status ${tapTest.status}:\n`
+ `|| ${tapTest.description}\n`
+ `|| for more information please take a look the logs above`);
}
}
// render fail Reasons
for (let failReason of failReasons) {
console.log(failReason);
}
if (optionsArg && optionsArg.throwOnError && failReasons.length > 0) {
process.exit(1);
}
});
}
/**
* handle errors
*/
threw(err) {
console.log(err);
}
}
exports.Tap = Tap;
exports.tap = new Tap();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLmNsYXNzZXMudGFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdGFwYnVuZGxlLmNsYXNzZXMudGFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFFQSwyRUFBb0U7QUFDcEUsMkVBQXVFO0FBQ3ZFO0lBQUE7UUFFRTs7V0FFRztRQUNILFNBQUksR0FBRztZQUNMLElBQUksRUFBRSxDQUFDLGNBQXNCLEVBQUUsV0FBMEIsRUFBRSxFQUFFO2dCQUMzRCxPQUFPLENBQUMsR0FBRyxDQUFDLGlCQUFpQixjQUFjLEVBQUUsQ0FBQyxDQUFBO1lBQ2hELENBQUM7U0FDRixDQUFBO1FBRU8sY0FBUyxHQUFjLEVBQUUsQ0FBQTtJQTZGbkMsQ0FBQztJQTNGQzs7OztPQUlHO0lBQ0csSUFBSSxDQUFFLGVBQXVCLEVBQUUsWUFBMkI7O1lBQzlELElBQUksU0FBUyxHQUFHLElBQUksbUNBQU8sQ0FBQztnQkFDMUIsV0FBVyxFQUFFLGVBQWU7Z0JBQzVCLFlBQVksRUFBRSxZQUFZO2dCQUMxQixRQUFRLEVBQUUsS0FBSzthQUNoQixDQUFDLENBQUE7WUFDRixJQUFJLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQTtZQUM5QixNQUFNLENBQUMsU0FBUyxDQUFBO1FBQ2xCLENBQUM7S0FBQTtJQUVEOztPQUVHO0lBQ0gsSUFBSSxDQUFFLFdBQTZCO1FBQ2pDLE1BQU0sQ0FBQyxJQUFJLG1DQUFPLENBQUMsV0FBVyxDQUFDLENBQUE7SUFDakMsQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxZQUFZLENBQUUsZUFBdUIsRUFBRSxZQUEyQjtRQUNoRSxJQUFJLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxJQUFJLG1DQUFPLENBQUM7WUFDOUIsV0FBVyxFQUFFLGVBQWU7WUFDNUIsWUFBWSxFQUFFLFlBQVk7WUFDMUIsUUFBUSxFQUFFLElBQUk7U0FDZixDQUFDLENBQUMsQ0FBQTtJQUNMLENBQUM7SUFFRDs7T0FFRztJQUNHLEtBQUssQ0FBQyxVQUVYOztZQUNDLElBQUksWUFBWSxHQUFtQixFQUFFLENBQUE7WUFFckMscUNBQXFDO1lBQ3JDLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUM7Z0JBQ2hDLE9BQU8sQ0FBQyxHQUFHLENBQUMsa0NBQWtDLENBQUMsQ0FBQTtnQkFDL0MsTUFBTSxDQUFBO1lBQ1IsQ0FBQztZQUVELE9BQU8sQ0FBQyxHQUFHLENBQUMsTUFBTSxJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUE7WUFDMUMsR0FBRyxDQUFDLENBQUMsSUFBSSxPQUFPLEdBQUcsQ0FBQyxFQUFFLE9BQU8sR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sRUFBRSxPQUFPLEVBQUUsRUFBRSxDQUFDO2dCQUNqRSxJQUFJLFdBQVcsR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFBO2dCQUN6QyxJQUFJLFdBQVcsR0FBRyxXQUFXLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFBO2dCQUMxQyxFQUFFLENBQUMsQ0FBQyxXQUFXLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQztvQkFDekIsWUFBWSxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQTtnQkFDaEMsQ0FBQztnQkFBQyxJQUFJLENBQUMsQ0FBQztvQkFDTixNQUFNLFdBQVcsQ0FBQTtnQkFDbkIsQ0FBQztZQUNILENBQUM7WUFDRCxNQUFNLE9BQU8sQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDLENBQUE7WUFFL0IsMkRBQTJEO1lBQzNELElBQUksV0FBVyxHQUFhLEVBQUUsQ0FBQTtZQUM5QixJQUFJLGNBQWMsR0FBYSxFQUFFLENBQUE7WUFDakMsdUJBQXVCO1lBQ3ZCLEdBQUcsQ0FBQyxDQUFDLElBQUksT0FBTyxJQUFJLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDO2dCQUNuQyxFQUFFLENBQUMsQ0FBQyxPQUFPLENBQUMsTUFBTSxLQUFLLFNBQVMsQ0FBQyxDQUFDLENBQUM7b0JBQ2pDLFdBQVcsQ0FBQyxJQUFJLENBQ2QsUUFBUSxPQUFPLENBQUMsT0FBTyxHQUFHLENBQUMsdUJBQXVCLE9BQU8sQ0FBQyxNQUFNLEtBQUs7MEJBQ25FLE1BQU0sT0FBTyxDQUFDLFdBQVcsSUFBSTswQkFDN0IsMkRBQTJELENBQzlELENBQUE7Z0JBQ0gsQ0FBQztZQUNILENBQUM7WUFFRCxzQkFBc0I7WUFDdEIsR0FBRyxDQUFDLENBQUMsSUFBSSxVQUFVLElBQUksV0FBVyxDQUFDLENBQUMsQ0FBQztnQkFDbkMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQTtZQUN6QixDQUFDO1lBRUQsRUFBRSxDQUFDLENBQUMsVUFBVSxJQUFJLFVBQVUsQ0FBQyxZQUFZLElBQUksV0FBVyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO2dCQUNwRSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFBO1lBQ2pCLENBQUM7UUFDSCxDQUFDO0tBQUE7SUFFRDs7T0FFRztJQUNILEtBQUssQ0FBRSxHQUFHO1FBQ1IsT0FBTyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQTtJQUNsQixDQUFDO0NBQ0Y7QUF4R0Qsa0JBd0dDO0FBRVUsUUFBQSxHQUFHLEdBQUcsSUFBSSxHQUFHLEVBQUUsQ0FBQSJ9

View File

@ -1,31 +0,0 @@
import { TapTools } from './tapbundle.classes.taptools';
import { HrtMeasurement } from 'early';
import { Deferred } from 'smartq';
export declare type TTestStatus = 'success' | 'error' | 'pending' | 'errorAfterSuccess' | 'timeout';
export interface ITestFunction {
(tapTools?: TapTools): Promise<any>;
}
export declare class TapTest {
description: string;
failureAllowed: boolean;
hrtMeasurement: HrtMeasurement;
parallel: boolean;
status: TTestStatus;
tapTools: TapTools;
testFunction: ITestFunction;
testKey: number;
testDeferred: Deferred<TapTest>;
testPromise: Promise<TapTest>;
/**
* constructor
*/
constructor(optionsArg: {
description: string;
testFunction: ITestFunction;
parallel: boolean;
});
/**
* run the test
*/
run(testKeyArg: number): Promise<void>;
}

View File

@ -1,69 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./tapbundle.plugins");
const tapbundle_classes_taptools_1 = require("./tapbundle.classes.taptools");
// imported interfaces
const early_1 = require("early");
class TapTest {
/**
* constructor
*/
constructor(optionsArg) {
this.testDeferred = plugins.smartq.defer();
this.testPromise = this.testDeferred.promise;
this.description = optionsArg.description;
this.hrtMeasurement = new early_1.HrtMeasurement();
this.parallel = optionsArg.parallel;
this.status = 'pending';
this.tapTools = new tapbundle_classes_taptools_1.TapTools(this);
this.testFunction = optionsArg.testFunction;
}
/**
* run the test
*/
run(testKeyArg) {
return __awaiter(this, void 0, void 0, function* () {
this.hrtMeasurement.start();
this.testKey = testKeyArg;
let testNumber = testKeyArg + 1;
try {
yield this.testFunction(this.tapTools);
if (this.status === 'timeout') {
throw new Error('Test succeeded, but timed out...');
}
this.hrtMeasurement.stop();
console.log(`ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`);
this.status = 'success';
this.testDeferred.resolve(this);
}
catch (err) {
this.hrtMeasurement.stop();
console.log(`not ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`);
this.testDeferred.resolve(this);
// if the test has already succeeded before
if (this.status === 'success') {
this.status = 'errorAfterSuccess';
console.log('!!! ALERT !!!: weird behaviour, since test has been already successfull');
}
else {
this.status = 'error';
}
// if the test is allowed to fail
if (this.failureAllowed) {
console.log(`please note: failure allowed!`);
}
console.log(err);
}
});
}
}
exports.TapTest = TapTest;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLmNsYXNzZXMudGFwdGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3RhcGJ1bmRsZS5jbGFzc2VzLnRhcHRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLCtDQUE4QztBQUU5Qyw2RUFBdUQ7QUFFdkQsc0JBQXNCO0FBQ3RCLGlDQUFzQztBQVd0QztJQVdFOztPQUVHO0lBQ0gsWUFBYSxVQUlaO1FBVEQsaUJBQVksR0FBc0IsT0FBTyxDQUFDLE1BQU0sQ0FBQyxLQUFLLEVBQUUsQ0FBQTtRQUN4RCxnQkFBVyxHQUFxQixJQUFJLENBQUMsWUFBWSxDQUFDLE9BQU8sQ0FBQTtRQVN2RCxJQUFJLENBQUMsV0FBVyxHQUFHLFVBQVUsQ0FBQyxXQUFXLENBQUE7UUFDekMsSUFBSSxDQUFDLGNBQWMsR0FBRyxJQUFJLHNCQUFjLEVBQUUsQ0FBQTtRQUMxQyxJQUFJLENBQUMsUUFBUSxHQUFHLFVBQVUsQ0FBQyxRQUFRLENBQUE7UUFDbkMsSUFBSSxDQUFDLE1BQU0sR0FBRyxTQUFTLENBQUE7UUFDdkIsSUFBSSxDQUFDLFFBQVEsR0FBRyxJQUFJLHFDQUFRLENBQUMsSUFBSSxDQUFDLENBQUE7UUFDbEMsSUFBSSxDQUFDLFlBQVksR0FBRyxVQUFVLENBQUMsWUFBWSxDQUFBO0lBQzdDLENBQUM7SUFFRDs7T0FFRztJQUNHLEdBQUcsQ0FBRSxVQUFrQjs7WUFDM0IsSUFBSSxDQUFDLGNBQWMsQ0FBQyxLQUFLLEVBQUUsQ0FBQTtZQUMzQixJQUFJLENBQUMsT0FBTyxHQUFHLFVBQVUsQ0FBQTtZQUN6QixJQUFJLFVBQVUsR0FBRyxVQUFVLEdBQUcsQ0FBQyxDQUFBO1lBQy9CLElBQUksQ0FBQztnQkFDSCxNQUFNLElBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFBO2dCQUN0QyxFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsTUFBTSxLQUFLLFNBQVMsQ0FBQyxDQUFDLENBQUM7b0JBQzlCLE1BQU0sSUFBSSxLQUFLLENBQUUsa0NBQWtDLENBQUMsQ0FBQTtnQkFDdEQsQ0FBQztnQkFDRCxJQUFJLENBQUMsY0FBYyxDQUFDLElBQUksRUFBRSxDQUFBO2dCQUMxQixPQUFPLENBQUMsR0FBRyxDQUFDLE1BQU0sVUFBVSxNQUFNLElBQUksQ0FBQyxXQUFXLFdBQVcsSUFBSSxDQUFDLGNBQWMsQ0FBQyxZQUFZLElBQUksQ0FBQyxDQUFBO2dCQUNsRyxJQUFJLENBQUMsTUFBTSxHQUFHLFNBQVMsQ0FBQTtnQkFDdkIsSUFBSSxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUE7WUFDakMsQ0FBQztZQUFDLEtBQUssQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7Z0JBQ2IsSUFBSSxDQUFDLGNBQWMsQ0FBQyxJQUFJLEVBQUUsQ0FBQTtnQkFDMUIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxVQUFVLFVBQVUsTUFBTSxJQUFJLENBQUMsV0FBVyxXQUFXLElBQUksQ0FBQyxjQUFjLENBQUMsWUFBWSxJQUFJLENBQUMsQ0FBQTtnQkFDdEcsSUFBSSxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUE7Z0JBRS9CLDJDQUEyQztnQkFDM0MsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLE1BQU0sS0FBSyxTQUFTLENBQUMsQ0FBQyxDQUFDO29CQUM5QixJQUFJLENBQUMsTUFBTSxHQUFHLG1CQUFtQixDQUFBO29CQUNqQyxPQUFPLENBQUMsR0FBRyxDQUFDLHlFQUF5RSxDQUFDLENBQUE7Z0JBQ3hGLENBQUM7Z0JBQUMsSUFBSSxDQUFDLENBQUM7b0JBQ04sSUFBSSxDQUFDLE1BQU0sR0FBRyxPQUFPLENBQUE7Z0JBQ3ZCLENBQUM7Z0JBRUQsaUNBQWlDO2dCQUNqQyxFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLENBQUMsQ0FBQztvQkFDeEIsT0FBTyxDQUFDLEdBQUcsQ0FBQywrQkFBK0IsQ0FBQyxDQUFBO2dCQUM5QyxDQUFDO2dCQUNELE9BQU8sQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUE7WUFDbEIsQ0FBQztRQUNILENBQUM7S0FBQTtDQUNGO0FBL0RELDBCQStEQyJ9

View File

@ -1,22 +0,0 @@
export interface IPromiseFunc {
(): Promise<any>;
}
export declare class TapTools {
/**
* the referenced TapTest
*/
private _tapTest;
constructor(TapTestArg: any);
/**
* allow failure
*/
allowFailure(): void;
/**
* async/await delay method
*/
delayFor(timeMilliArg: any): Promise<void>;
delayForRandom(timeMilliMinArg: any, timeMilliMaxArg: any): Promise<void>;
timeout(timeMilliArg: number): Promise<void>;
checkIterationLeak(iterationfuncArg: IPromiseFunc): Promise<void>;
returnError(throwingFuncArg: IPromiseFunc): Promise<Error>;
}

View File

@ -1,64 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./tapbundle.plugins");
class TapTools {
constructor(TapTestArg) {
this._tapTest = TapTestArg;
}
/**
* allow failure
*/
allowFailure() {
this._tapTest.failureAllowed = true;
}
/**
* async/await delay method
*/
delayFor(timeMilliArg) {
return __awaiter(this, void 0, void 0, function* () {
yield plugins.smartdelay.delayFor(timeMilliArg);
});
}
delayForRandom(timeMilliMinArg, timeMilliMaxArg) {
return __awaiter(this, void 0, void 0, function* () {
yield plugins.smartdelay.delayForRandom(timeMilliMinArg, timeMilliMaxArg);
});
}
timeout(timeMilliArg) {
return __awaiter(this, void 0, void 0, function* () {
let timeout = new plugins.smartdelay.Timeout(timeMilliArg);
timeout.makeUnrefed();
yield timeout.promise;
if (this._tapTest.status === 'pending') {
this._tapTest.status = 'timeout';
}
});
}
checkIterationLeak(iterationfuncArg) {
return __awaiter(this, void 0, void 0, function* () {
yield plugins.leakage.iterate.async(iterationfuncArg);
});
}
returnError(throwingFuncArg) {
return __awaiter(this, void 0, void 0, function* () {
let funcErr;
try {
yield throwingFuncArg();
}
catch (err) {
funcErr = err;
}
return funcErr;
});
}
}
exports.TapTools = TapTools;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLmNsYXNzZXMudGFwdG9vbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90YXBidW5kbGUuY2xhc3Nlcy50YXB0b29scy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsK0NBQThDO0FBTzlDO0lBT0UsWUFBYSxVQUFVO1FBQ3JCLElBQUksQ0FBQyxRQUFRLEdBQUcsVUFBVSxDQUFBO0lBQzVCLENBQUM7SUFFRDs7T0FFRztJQUNILFlBQVk7UUFDVixJQUFJLENBQUMsUUFBUSxDQUFDLGNBQWMsR0FBRyxJQUFJLENBQUE7SUFDckMsQ0FBQztJQUVEOztPQUVHO0lBQ0csUUFBUSxDQUFFLFlBQVk7O1lBQzFCLE1BQU0sT0FBTyxDQUFDLFVBQVUsQ0FBQyxRQUFRLENBQUMsWUFBWSxDQUFDLENBQUE7UUFDakQsQ0FBQztLQUFBO0lBRUssY0FBYyxDQUFFLGVBQWUsRUFBRSxlQUFlOztZQUNwRCxNQUFNLE9BQU8sQ0FBQyxVQUFVLENBQUMsY0FBYyxDQUFDLGVBQWUsRUFBRSxlQUFlLENBQUMsQ0FBQTtRQUMzRSxDQUFDO0tBQUE7SUFFSyxPQUFPLENBQUUsWUFBb0I7O1lBQ2pDLElBQUksT0FBTyxHQUFHLElBQUksT0FBTyxDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsWUFBWSxDQUFDLENBQUE7WUFDMUQsT0FBTyxDQUFDLFdBQVcsRUFBRSxDQUFBO1lBQ3JCLE1BQU0sT0FBTyxDQUFDLE9BQU8sQ0FBQTtZQUNyQixFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLE1BQU0sS0FBSyxTQUFTLENBQUMsQ0FBQyxDQUFDO2dCQUN2QyxJQUFJLENBQUMsUUFBUSxDQUFDLE1BQU0sR0FBRyxTQUFTLENBQUE7WUFDbEMsQ0FBQztRQUNILENBQUM7S0FBQTtJQUVLLGtCQUFrQixDQUFFLGdCQUE4Qjs7WUFDdEQsTUFBTSxPQUFPLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsZ0JBQWdCLENBQUMsQ0FBQTtRQUN2RCxDQUFDO0tBQUE7SUFFSyxXQUFXLENBQUUsZUFBNkI7O1lBQzlDLElBQUksT0FBYyxDQUFBO1lBQ2xCLElBQUksQ0FBQztnQkFDSCxNQUFNLGVBQWUsRUFBRSxDQUFBO1lBQ3pCLENBQUM7WUFBQyxLQUFLLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO2dCQUNiLE9BQU8sR0FBRyxHQUFHLENBQUE7WUFDZixDQUFDO1lBQ0QsTUFBTSxDQUFDLE9BQU8sQ0FBQTtRQUNoQixDQUFDO0tBQUE7Q0FDRjtBQW5ERCw0QkFtREMifQ==

View File

@ -1,14 +0,0 @@
export interface ITapWrapFunction {
(): Promise<any>;
}
export declare class TapWrap {
wrapFunction: ITapWrapFunction;
/**
* the constructor
*/
constructor(wrapFunctionArg: ITapWrapFunction);
/**
* run the wrapFunction
*/
run(): Promise<void>;
}

View File

@ -1,29 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
class TapWrap {
/**
* the constructor
*/
constructor(wrapFunctionArg) {
// nothing here
this.wrapFunction = wrapFunctionArg;
}
/**
* run the wrapFunction
*/
run() {
return __awaiter(this, void 0, void 0, function* () {
yield this.wrapFunction();
});
}
}
exports.TapWrap = TapWrap;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLmNsYXNzZXMudGFwd3JhcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3RhcGJ1bmRsZS5jbGFzc2VzLnRhcHdyYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQU1BO0lBR0U7O09BRUc7SUFDSCxZQUFhLGVBQWlDO1FBQzVDLGVBQWU7UUFDZixJQUFJLENBQUMsWUFBWSxHQUFHLGVBQWUsQ0FBQTtJQUNyQyxDQUFDO0lBRUQ7O09BRUc7SUFDRyxHQUFHOztZQUNQLE1BQU0sSUFBSSxDQUFDLFlBQVksRUFBRSxDQUFBO1FBQzNCLENBQUM7S0FBQTtDQUNGO0FBakJELDBCQWlCQyJ9

View File

@ -1,5 +0,0 @@
import * as early from 'early';
import * as leakage from 'leakage';
import * as smartdelay from 'smartdelay';
import * as smartq from 'smartq';
export { early, smartdelay, smartq, leakage };

View File

@ -1,11 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const early = require("early");
exports.early = early;
const leakage = require("leakage");
exports.leakage = leakage;
const smartdelay = require("smartdelay");
exports.smartdelay = smartdelay;
const smartq = require("smartq");
exports.smartq = smartq;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90YXBidW5kbGUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLCtCQUE4QjtBQU01QixzQkFBSztBQUxQLG1DQUFrQztBQVFoQywwQkFBTztBQVBULHlDQUF3QztBQUt0QyxnQ0FBVTtBQUpaLGlDQUFnQztBQUs5Qix3QkFBTSJ9

View File

@ -1,3 +0,0 @@
export declare class TapCreator {
}
export declare let tapCreator: TapCreator;

View File

@ -1,7 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class TapCreator {
}
exports.TapCreator = TapCreator;
exports.tapCreator = new TapCreator();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwYnVuZGxlLnRhcGNyZWF0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90YXBidW5kbGUudGFwY3JlYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBO0NBRUM7QUFGRCxnQ0FFQztBQUVVLFFBQUEsVUFBVSxHQUFHLElBQUksVUFBVSxFQUFFLENBQUEifQ==

View File

@ -1,55 +0,0 @@
# Get Started
## TypeScript
Use TypeScript for best in class instellisense.
A few words on TypeScript
## Included in this package
* tap compatible testing framework written in TypeScript
* a collection of test tools
* **code** testing framework with typings
## Write your first tests
``` javascript
import {tap, expect} from 'tapbundle' // has typings in place
import * as myAwesomeModuleToTest from '../dist/index' // '../dist/index' is the standard path for npmts modules
tap.test('my awesome description', async (tools) => { // tools are optional parameter
tools.timeout(2000) // test will fail if it takes longer than 2000 millisenconds
})
let myTest2 = tap.test('my awesome test 2', async (tools) => {
myAwsomeModuleToTest.doSomethingAsync() // we don't wait here
await tools.delayFor(3000) // yay! :) promise based timeouts :)
console.log('This gets logged 3000 ms into the test')
})
tap.test('my awesome test 3', async (tools) => {
expect(true).to.be.true // will not throw
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 :)
})
let myTest4 = tap.testParallel('my awesome test 4', async (tools) => {
await tools.delayFor(4000)
console.log('logs to console after 4 seconds into this test')
})
tap.test('my awesome test 5', async () => {
expect(myTest4.status).to.equal('pending') // since this test will likely finish before myTest4.
})
tap.start() // start the test, will automtically plan tests for you (so the tap parser knows when tests exit bofore they are finished)
```
For further information read the linked docs at the top of this README.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

View File

@ -1,26 +0,0 @@
# tapbundle
tap bundled for tapbuffer
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/tapbundle)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/tapbundle)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/tapbundle)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/tapbundle/)
## Status for master
[![build status](https://GitLab.com/pushrocks/tapbundle/badges/master/build.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master)
[![coverage report](https://GitLab.com/pushrocks/tapbundle/badges/master/coverage.svg)](https://GitLab.com/pushrocks/tapbundle/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/tapbundle.svg)](https://www.npmjs.com/package/tapbundle)
[![Dependency Status](https://david-dm.org/pushrocks/tapbundle.svg)](https://david-dm.org/pushrocks/tapbundle)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/tapbundle/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/tapbundle/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/tapbundle/badges/code.svg)](https://www.bithound.io/github/pushrocks/tapbundle)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
For further information read the linked docs at the top of this README.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

View File

@ -1,87 +0,0 @@
# Copyright (c) 2016-2017 Martin Donath <martin.donath@squidfunk.com>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
# Project information
site_name: tapbundle | docs
site_description: a taprunner
site_author: Lossless GmbH
site_url: https://push.rocks
# Repository
repo_name: pushrocks/tapbundle
repo_url: https://gitlab.com/pushrocks/tapbundle
# Copyright
copyright: 'Copyright &copy; 2014 Lossless GmbH'
# Theme directory
theme: material
theme_dir: 'theme'
# Options
extra:
feature:
tabs: false
palette:
primary: indigo
accent: indigo
social:
- type: globe
link: http://lossless.com
- type: github-alt
link: https://github.com/philkunz
- type: twitter
link: https://twitter.com/philkunzcom
- type: linkedin
link: https://linkedin.com/in/philippkunz
# Extensions
markdown_extensions:
- markdown.extensions.admonition
- markdown.extensions.codehilite(guess_lang=false, linenums=true)
- markdown.extensions.def_list
- markdown.extensions.footnotes
- markdown.extensions.meta
- markdown.extensions.toc(permalink=true)
- pymdownx.arithmatex
- pymdownx.betterem(smart_enable=all)
- pymdownx.caret
- pymdownx.critic
- pymdownx.details
- pymdownx.emoji:
emoji_generator: !!python/name:pymdownx.emoji.to_svg
- pymdownx.inlinehilite
- pymdownx.magiclink
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.superfences
- pymdownx.tasklist(custom_checkbox=true)
- pymdownx.tilde
# Page tree
pages:
- Repo Readme: index.md
- Get Started: getstarted.md
- License: license.md
# Google Analytics
google_analytics:
- !!python/object/apply:os.getenv ["GOOGLE_ANALYTICS_KEY"]
- auto

View File

@ -1,56 +0,0 @@
{% import "partials/language.html" as lang %}
<footer class="md-footer">
{% if page.previous_page or page.next_page %}
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid">
{% if page.previous_page %}
<a href="{{ page.previous_page.url }}" title="{{ page.previous_page.title }}" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
</div>
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
{{ lang.t("footer.previous") }}
</span>
{{ page.previous_page.title }}
</span>
</div>
</a>
{% endif %}
{% if page.next_page %}
<a href="{{ page.next_page.url }}" title="{{ page.next_page.title }}" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
{{ lang.t("footer.next") }}
</span>
{{ page.next_page.title }}
</span>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
</div>
</a>
{% endif %}
</nav>
</div>
{% endif %}
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
{% if config.copyright %}
<div class="md-footer-copyright__highlight">
{{ config.copyright }}
</div>
{% endif %}
<a href="https://lossless.gmbh" title="push.rocks">Impressum</a>
|
<a href="https://lossless.com" title="Lossless GmbH">Company Website</a>
</div>
{% block social %}
{% include "partials/social.html" %}
{% endblock %}
</div>
</div>
</footer>

View File

@ -1,7 +1,6 @@
# License
**MIT License** **MIT License**
Copright &copy; 2016 Lossless GmbH
Copyright &copy; 2016 - 2017 Martin Donath Copyright &copy; 2016 - 2017 Martin Donath
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@ -1,12 +1,39 @@
{ {
"npmci": { "npmci": {
"npmGlobalTools": [ "npmGlobalTools": [],
"npmts" "npmAccessLevel": "public"
]
}, },
"npmts": { "npmts": {
"testConfig": { "testConfig": {
"parallel": false "parallel": false
} }
},
"gitzone": {
"projectType": "npm",
"module": {
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "tapbundle",
"description": "A test automation library bundling utilities and tools for TAP (Test Anything Protocol) based testing, specifically tailored for tapbuffer.",
"npmPackagename": "@push.rocks/tapbundle",
"license": "MIT",
"keywords": [
"testing",
"automation",
"TAP",
"test anything protocol",
"unit testing",
"integration testing",
"JavaScript",
"TypeScript",
"test runner",
"test framework",
"web helpers",
"test utilities"
]
}
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
} }
} }

422
package-lock.json generated
View File

@ -1,422 +0,0 @@
{
"name": "tapbundle",
"version": "2.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/node": {
"version": "8.0.33",
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.33.tgz",
"integrity": "sha512-vmCdO8Bm1ExT+FWfC9sd9r4jwqM7o97gGy2WBshkkXbf/2nLAJQUrZfIhw27yVOtLUev6kSZc4cav/46KbDd8A=="
},
"early": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/early/-/early-2.1.1.tgz",
"integrity": "sha1-hB4jJU6l3FTYr67ugvWrZcAO4jw=",
"requires": {
"beautycolor": "1.0.7",
"smartq": "1.1.1",
"typings-global": "1.0.19"
},
"dependencies": {
"beautycolor": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/beautycolor/-/beautycolor-1.0.7.tgz",
"integrity": "sha1-pHFXOKxMgiE3Hpy+tabMbRHsv3w=",
"requires": {
"ansi-256-colors": "1.1.0",
"typings-global": "1.0.19"
},
"dependencies": {
"ansi-256-colors": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz",
"integrity": "sha1-kQ3lDvzHwJ49gvL4er1rcAwYgYo="
}
}
}
}
},
"leakage": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/leakage/-/leakage-0.3.0.tgz",
"integrity": "sha1-FdaYq9x2u8ZDlgH08wIOd+LVDDk=",
"requires": {
"es6-error": "4.0.2",
"left-pad": "1.1.3",
"memwatch-next": "0.3.0",
"minimist": "1.2.0",
"pretty-bytes": "4.0.2"
},
"dependencies": {
"es6-error": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.0.2.tgz",
"integrity": "sha1-7sXHJurO9Rt/a3PCDbbhsTsGnJg="
},
"left-pad": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.1.3.tgz",
"integrity": "sha1-YS9hwDPzqeCOk58crr7qQbbzGZo="
},
"memwatch-next": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/memwatch-next/-/memwatch-next-0.3.0.tgz",
"integrity": "sha1-IREFD5qQbgqi1ypOwPAInHhyb48=",
"requires": {
"bindings": "1.2.1",
"nan": "2.6.2"
},
"dependencies": {
"bindings": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz",
"integrity": "sha1-FK1hE4EtLTfXLme0ystLtyZQXxE="
},
"nan": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz",
"integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U="
}
}
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"pretty-bytes": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz",
"integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk="
}
}
},
"smartchai": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/smartchai/-/smartchai-1.0.3.tgz",
"integrity": "sha1-3m0BC7i1rvJMtwsxpfUzToxBty8=",
"requires": {
"@types/chai": "3.5.2",
"@types/chai-as-promised": "0.0.29",
"@types/chai-string": "1.1.30",
"chai": "3.5.0",
"chai-as-promised": "6.0.0",
"chai-string": "1.4.0"
},
"dependencies": {
"@types/chai": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-3.5.2.tgz",
"integrity": "sha1-wRzSgX06QBt7oPWkIPNcVhObHB4="
},
"@types/chai-as-promised": {
"version": "0.0.29",
"resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-0.0.29.tgz",
"integrity": "sha1-Q9UokqqZjhhaPePiR37bhXO+HXc=",
"requires": {
"@types/chai": "3.5.2",
"@types/promises-a-plus": "0.0.27"
},
"dependencies": {
"@types/promises-a-plus": {
"version": "0.0.27",
"resolved": "https://registry.npmjs.org/@types/promises-a-plus/-/promises-a-plus-0.0.27.tgz",
"integrity": "sha1-xkZRE0YUyEuPXXEUzokB02pgl4A="
}
}
},
"@types/chai-string": {
"version": "1.1.30",
"resolved": "https://registry.npmjs.org/@types/chai-string/-/chai-string-1.1.30.tgz",
"integrity": "sha1-TYdEsxpaIpX8AcmB7R4tTIoHDwo=",
"requires": {
"@types/chai": "3.5.2"
}
},
"chai": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz",
"integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=",
"requires": {
"assertion-error": "1.0.2",
"deep-eql": "0.1.3",
"type-detect": "1.0.0"
},
"dependencies": {
"assertion-error": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.2.tgz",
"integrity": "sha1-E8pRXYYgbaC6xm6DTdOX2HWBCUw="
},
"deep-eql": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz",
"integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=",
"requires": {
"type-detect": "0.1.1"
},
"dependencies": {
"type-detect": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz",
"integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI="
}
}
},
"type-detect": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz",
"integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI="
}
}
},
"chai-as-promised": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-6.0.0.tgz",
"integrity": "sha1-GgKkM6byTa+sY7nJb6FoTbGqjaY=",
"requires": {
"check-error": "1.0.2"
},
"dependencies": {
"check-error": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
"integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII="
}
}
},
"chai-string": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.4.0.tgz",
"integrity": "sha1-NZFAwFHTak5LGl/GuRAVL0OKjUk="
}
}
},
"smartdelay": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/smartdelay/-/smartdelay-1.0.3.tgz",
"integrity": "sha1-X9RNrXcmLREHAvApPvqAwHLPtXk=",
"requires": {
"smartq": "1.1.1",
"typings-global": "1.0.19"
}
},
"smartq": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/smartq/-/smartq-1.1.1.tgz",
"integrity": "sha1-77NYcFJg1Brhiu9//YFfe2/hfdM=",
"requires": {
"typed-promisify": "0.3.0",
"typings-global": "1.0.19"
},
"dependencies": {
"typed-promisify": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/typed-promisify/-/typed-promisify-0.3.0.tgz",
"integrity": "sha1-G6CvXkRMh9gEdAbxjOSQkqEZGFM="
}
}
},
"typings-global": {
"version": "1.0.19",
"resolved": "https://registry.npmjs.org/typings-global/-/typings-global-1.0.19.tgz",
"integrity": "sha1-M3anLU3h5VQb9XAiSP9kw+bqMWw=",
"requires": {
"semver": "5.3.0",
"smartshell": "1.0.8"
},
"dependencies": {
"semver": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
"integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8="
},
"smartshell": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/smartshell/-/smartshell-1.0.8.tgz",
"integrity": "sha1-FTV1bA/oBp9+baHj+ctsj3cJTkI=",
"requires": {
"@types/shelljs": "0.7.2",
"@types/which": "1.0.28",
"shelljs": "0.7.8",
"smartq": "1.1.1",
"typings-global": "1.0.19",
"which": "1.2.14"
},
"dependencies": {
"@types/shelljs": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.2.tgz",
"integrity": "sha1-wr2z/oDNej2gh1DKiYrkTFiWcfM=",
"requires": {
"@types/node": "8.0.7"
},
"dependencies": {
"@types/node": {
"version": "8.0.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.7.tgz",
"integrity": "sha1-+wrQS1tvbqvgNyoyqPH7ulwTDK4="
}
}
},
"@types/which": {
"version": "1.0.28",
"resolved": "https://registry.npmjs.org/@types/which/-/which-1.0.28.tgz",
"integrity": "sha1-AW44dim4gXvtZT/jLqtdESecjfY="
},
"shelljs": {
"version": "0.7.8",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz",
"integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=",
"requires": {
"glob": "7.1.2",
"interpret": "1.0.3",
"rechoir": "0.6.2"
},
"dependencies": {
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=",
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
},
"dependencies": {
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "1.4.0",
"wrappy": "1.0.2"
},
"dependencies": {
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=",
"requires": {
"brace-expansion": "1.1.8"
},
"dependencies": {
"brace-expansion": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
"requires": {
"balanced-match": "1.0.0",
"concat-map": "0.0.1"
},
"dependencies": {
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
}
}
}
}
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1.0.2"
},
"dependencies": {
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}
}
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
}
}
},
"interpret": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz",
"integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A="
},
"rechoir": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
"integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
"requires": {
"resolve": "1.3.3"
},
"dependencies": {
"resolve": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz",
"integrity": "sha1-ZVkHw0aahoDcLeOidaj91paR8OU=",
"requires": {
"path-parse": "1.0.5"
},
"dependencies": {
"path-parse": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME="
}
}
}
}
}
}
},
"which": {
"version": "1.2.14",
"resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz",
"integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=",
"requires": {
"isexe": "2.0.0"
},
"dependencies": {
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
}
}
}
}
}
}
}
}
}

View File

@ -1,31 +1,77 @@
{ {
"name": "tapbundle", "name": "@push.rocks/tapbundle",
"version": "2.0.0", "private": false,
"description": "tap bundled for tapbuffer", "version": "5.4.0",
"main": "dist/index.js", "description": "A test automation library bundling utilities and tools for TAP (Test Anything Protocol) based testing, specifically tailored for tapbuffer.",
"typings": "dist/index.d.ts", "exports": {
".": "./dist_ts/index.js",
"./node": "./dist_ts_node/index.js"
},
"type": "module",
"scripts": { "scripts": {
"test": "(npmts)" "test": "(tstest test/)",
"build": "(tsbuild tsfolders --web --allowimplicitany --skiplibcheck)",
"buildDocs": "tsdoc"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+ssh://git@gitlab.com/pushrocks/tapbundle.git" "url": "https://code.foss.global/push.rocks/tapbundle.git"
}, },
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://gitlab.com/pushrocks/tapbundle/issues" "url": "https://gitlab.com/pushrocks/tapbundle/issues"
}, },
"homepage": "https://gitlab.com/pushrocks/tapbundle#README", "homepage": "https://code.foss.global/push.rocks/tapbundle",
"dependencies": { "dependencies": {
"early": "^2.1.1", "@open-wc/testing": "^4.0.0",
"leakage": "^0.3.0", "@push.rocks/consolecolor": "^2.0.2",
"smartchai": "^2.0.0", "@push.rocks/qenv": "^6.0.5",
"smartdelay": "^1.0.3", "@push.rocks/smartcrypto": "^2.0.4",
"smartq": "^1.1.1" "@push.rocks/smartdelay": "^3.0.5",
"@push.rocks/smartenv": "^5.0.12",
"@push.rocks/smartexpect": "^1.2.1",
"@push.rocks/smartjson": "^5.0.20",
"@push.rocks/smartmongo": "^2.0.10",
"@push.rocks/smartpromise": "^4.0.4",
"@push.rocks/smarts3": "^2.2.1",
"@push.rocks/smartshell": "^3.0.6",
"@push.rocks/smarttime": "^4.0.8"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^9.4.6", "@git.zone/tsbuild": "^2.1.66",
"randomstring": "^1.1.5" "@git.zone/tsrun": "^1.2.43",
} "@git.zone/tstest": "^1.0.77",
"@types/node": "^22.5.5",
"randomstring": "^1.3.0"
},
"files": [
"ts/**/*",
"ts_web/**/*",
"dist/**/*",
"dist_*/**/*",
"dist_ts/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
"npmextra.json",
"readme.md"
],
"browserslist": [
"last 1 chrome versions"
],
"keywords": [
"testing",
"automation",
"TAP",
"test anything protocol",
"unit testing",
"integration testing",
"JavaScript",
"TypeScript",
"test runner",
"test framework",
"web helpers",
"test utilities"
]
} }

7900
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

138
readme.md Normal file
View File

@ -0,0 +1,138 @@
# @push.rocks/tapbundle
tap bundled for tapbuffer
## Install
Install the package by running the following command in your terminal:
```bash
npm install @push.rocks/tapbundle --save-dev
```
This will add `@push.rocks/tapbundle` to your project's `devDependencies`.
## Usage
The `@push.rocks/tapbundle` package is a tap-compatible testing framework written in TypeScript, intended for use with tapbuffer. It includes a range of useful features enabling easy setup and execution of tests, assertion handling through `expect` and `expectAsync`, as well as auxiliary tools for delay and colored console output.
### Getting Started
First, ensure your project is set up with Typescript and supports ESM syntax. You can then import `tap`, `expect`, and `expectAsync` from `@push.rocks/tapbundle` to start defining your tests.
```typescript
import { tap, expect, expectAsync } from '@push.rocks/tapbundle';
```
Here is a simple test example:
```typescript
import { tap, expect } from '@push.rocks/tapbundle';
tap.test('should succeed on true assertion', async () => {
return expect(true).toBeTrue();
});
tap.start();
```
### Defining Tests
You can define tests with descriptions and async functions. The `tap` instance manages test execution, supports test skipping, and managing exclusive tests with the `.only` modifier.
```typescript
const myTest = tap.test('expect true to be true', async () => {
expect(true).toBeTrue();
});
const skippedTest = tap.skip.test('this test is skipped', async () => {
// This will not be executed
});
tap.only.test('only this test will run', async () => {
expect('TapBundle').toContainString('Tap');
});
tap.start();
```
### Using `expect` and `expectAsync`
The package provides `expect` and `expectAsync` for assertions:
```typescript
await expectAsync(Promise.resolve(true)).toBeResolved();
expect(5).toBeGreaterThan(2);
```
### Handling Asynchronous Operations
`tapbundle` facilitates working with async operations in tests. You can introduce delays or set timeouts:
```typescript
tap.test('async operation with delay', async (tools) => {
await tools.delayFor(2000); // Wait for 2000 milliseconds
expect(true).toBeTrue();
});
tap.start();
```
### Advanced Usage
#### Pre Tasks
You can define tasks to run before test execution begins:
```typescript
tap.preTask('setup database', async () => {
// Perform setup here
});
tap.test('test database connection', async () => {
// Test the setup
});
tap.start();
```
#### Accessing Test Metadata
Each test returns a `TapTest` instance, from which you can access metadata and manipulate test behavior:
```typescript
const test = tap.test('metadata example', async (tools) => {
tools.allowFailure();
expect(true).toBeTrue();
});
tap.start().then(() => {
console.log(`Test duration: ${test.hrtMeasurement.milliSeconds}ms`);
});
```
### Running Tests
Tests are executed by calling `tap.start()`. This method runs all defined tests in sequence and respects `.skip` and `.only` modifiers.
### Debugging and Output
`@push.rocks/tapbundle` supports colored console output via `consolecolor` to help with debugging and test result readability:
```typescript
tap.test('colored output', async (tools) => {
const coloredString = await tools.coloredString('Hello, world!', 'green');
console.log(coloredString);
});
tap.start();
```
This detailed guide covers the most important aspects of using `@push.rocks/tapbundle` for testing in your TypeScript projects. Explore the included functions and tools to fully leverage this comprehensive testing framework.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

View File

@ -0,0 +1,48 @@
import { tap, expect, webhelpers } from '../ts/index.js';
tap.preTask('custompretask', async () => {
console.log('this is a pretask');
});
tap.test('should have access to webhelpers', async () => {
const myElement = await webhelpers.fixture(webhelpers.html`<div></div>`);
expect(myElement).toBeInstanceOf(HTMLElement);
console.log(myElement);
});
const test1 = tap.test('my first test -> expect true to be true', async () => {
return expect(true).toBeTrue();
});
const test2 = tap.test('my second test', async (tools) => {
await tools.delayFor(50);
});
const test3 = tap.test(
'my third test -> test2 should take longer than test1 and endure at least 1000ms',
async () => {
expect(
(await test1.testPromise).hrtMeasurement.milliSeconds <
(await test2).hrtMeasurement.milliSeconds
).toBeTrue();
expect((await test2.testPromise).hrtMeasurement.milliSeconds > 10).toBeTrue();
}
);
const test4 = tap.skip.test('my 4th test -> should fail', async (tools) => {
tools.allowFailure();
expect(false).toBeTrue();
});
const test5 = tap.test('my 5th test -> should pass in about 500ms', async (tools) => {
tools.timeout(1000);
await tools.delayFor(500);
});
const test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async (tools) => {
tools.allowFailure();
tools.timeout(1000);
await tools.delayFor(100);
});
await tap.start();

View File

@ -1,21 +0,0 @@
import { tap, expect } from '../ts/index'
import * as randomstring from 'randomstring'
let test1 = tap.test('my first test -> expect true to be true', async (tools) => {
await tools.checkIterationLeak(async () => {
let domain = randomstring.generate(1000)
})
})
let outsideArray = []
let test2 = tap.test('should throw', async (tools) => {
let err = await tools.returnError(async () => {
await tools.checkIterationLeak(async () => {
outsideArray.push(randomstring.generate(1000))
})
})
expect(err).to.be.instanceof(Error)
})
tap.start()

28
test/test.node.ts Normal file
View File

@ -0,0 +1,28 @@
import { tap, expect } from '../ts/index.js';
import { tapNodeTools } from '../ts_node/index.js';
tap.test('should execure a command', async () => {
const result = await tapNodeTools.runCommand('ls -la');
expect(result.exitCode).toEqual(0);
});
tap.test('should create a https cert', async () => {
const { key, cert } = await tapNodeTools.createHttpsCert('localhost');
console.log(key);
console.log(cert);
expect(key).toInclude('-----BEGIN RSA PRIVATE KEY-----');
expect(cert).toInclude('-----BEGIN CERTIFICATE-----');
});
tap.test('should create a smartmongo instance', async () => {
const smartmongo = await tapNodeTools.createSmartmongo();
await smartmongo.stop();
});
tap.test('should create a smarts3 instance', async () => {
const smarts3 = await tapNodeTools.createSmarts3();
await smarts3.stop();
});
tap.start();

View File

@ -1,10 +1,5 @@
import { tap, expect } from '../dist/index' import { tap, expect, TapWrap } from '../ts/index.js';
let 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();

View File

@ -1,32 +1,49 @@
import { tap, expect } from '../ts/index' import { tap, expect } from '../ts/index.js';
let test1 = tap.test('my first test -> expect true to be true', async () => { tap.preTask('hi there', async () => {
return expect(true).to.be.true console.log('this is a pretask');
}) });
let test2 = tap.test('my second test', async (tools) => { const test1 = tap.test('my first test -> expect true to be true', async () => {
await tools.delayFor(1000) return expect(true).toBeTrue();
}) });
let test3 = tap.test('my third test -> test2 should take longer than test1 and endure at least 1000ms', async () => { const test2 = tap.test('my second test', async (tools) => {
expect((await test1).hrtMeasurement.milliSeconds < (await test2).hrtMeasurement.milliSeconds).to.be.true await tools.delayFor(1000);
expect((await test2).hrtMeasurement.milliSeconds > 1000).to.be.true });
})
let test4 = tap.skip.test('my 4th test -> should fail', async (tools) => { const test3 = tap.test(
tools.allowFailure() 'my third test -> test2 should take longer than test1 and endure at least 1000ms',
expect(false).to.be.true async () => {
}) expect(
(await test1.testPromise).hrtMeasurement.milliSeconds <
(await test2).hrtMeasurement.milliSeconds
).toBeTrue();
expect((await test2.testPromise).hrtMeasurement.milliSeconds > 1000).toBeTrue();
}
);
let test5 = tap.test('my 5th test -> should pass in about 500ms', async (tools) => { const test4 = tap.test('my 4th test -> should fail', async (tools) => {
tools.timeout(1000) tools.allowFailure();
await tools.delayFor(500) expect(false).toBeFalse();
}) return 'hello';
});
let test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async (tools) => { const test5 = tap.test('my 5th test -> should pass in about 500ms', async (tools) => {
tools.allowFailure() const test4Result = await test4.testResultPromise;
tools.timeout(1000) tools.timeout(1000);
await tools.delayFor(2000) await tools.delayFor(500);
}) });
tap.start() const test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async (tools) => {
tools.allowFailure();
tools.timeout(1000);
await tools.delayFor(2000);
});
const test7 = tap.test('my 7th test -> should print a colored string', async (tools) => {
const cs = await tools.coloredString('hello', 'red', 'cyan');
console.log(cs);
});
tap.start();

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@push.rocks/tapbundle',
version: '5.4.0',
description: 'A test automation library bundling utilities and tools for TAP (Test Anything Protocol) based testing, specifically tailored for tapbuffer.'
}

View File

@ -1,2 +1,7 @@
export { expect } from 'smartchai' export { tap } from './tapbundle.classes.tap.js';
export { tap } from './tapbundle.classes.tap' export { TapWrap } from './tapbundle.classes.tapwrap.js';
export { webhelpers } from './webhelpers.js';
import { expect, expectAsync } from '@push.rocks/smartexpect';
export { expect, expectAsync };

View File

@ -0,0 +1,21 @@
import * as plugins from './tapbundle.plugins.js';
import { TapTools } from './tapbundle.classes.taptools.js';
export interface IPreTaskFunction {
(tapTools?: TapTools): Promise<any>;
}
export class PreTask {
public description: string;
public preTaskFunction: IPreTaskFunction;
constructor(descriptionArg: string, preTaskFunctionArg: IPreTaskFunction) {
this.description = descriptionArg;
this.preTaskFunction = preTaskFunctionArg;
}
public async run() {
console.log(`::__PRETASK: ${this.description}`);
await this.preTaskFunction(new TapTools(null));
}
}

View File

@ -1,40 +1,59 @@
import * as plugins from './tapbundle.plugins' import * as plugins from './tapbundle.plugins.js';
import { TapTest, ITestFunction } from './tapbundle.classes.taptest' import { type IPreTaskFunction, PreTask } from './tapbundle.classes.pretask.js';
import { TapWrap, ITapWrapFunction } from './tapbundle.classes.tapwrap' import { TapTest, type ITestFunction } from './tapbundle.classes.taptest.js';
export class Tap { export class Tap<T> {
/**
* skips a test
* tests marked with tap.skip.test() are never executed
*/
public skip = {
test: (descriptionArg: string, functionArg: ITestFunction<T>) => {
console.log(`skipped test: ${descriptionArg}`);
},
testParallel: (descriptionArg: string, functionArg: ITestFunction<T>) => {
console.log(`skipped test: ${descriptionArg}`);
},
};
/** /**
* skip a test * only executes tests marked as ONLY
*/ */
skip = { public only = {
test: (descriptionArg: string, functionArg: ITestFunction) => { test: (descriptionArg: string, testFunctionArg: ITestFunction<T>) => {
console.log(`skipped test: ${descriptionArg}`) this.test(descriptionArg, testFunctionArg, 'only');
} },
} };
private _tapTests: TapTest[] = [] private _tapPreTasks: PreTask[] = [];
private _tapTests: TapTest<any>[] = [];
private _tapTestsOnly: TapTest<any>[] = [];
/** /**
* Normal test function, will run one by one * Normal test function, will run one by one
* @param testDescription - A description of what the test does * @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects * @param testFunction - A Function that returns a Promise and resolves or rejects
*/ */
async test (testDescription: string, testFunction: ITestFunction) { public test(
let localTest = new TapTest({ testDescription: string,
testFunction: ITestFunction<T>,
modeArg: 'normal' | 'only' | 'skip' = 'normal'
): TapTest<T> {
const localTest = new TapTest<T>({
description: testDescription, description: testDescription,
testFunction: testFunction, testFunction,
parallel: false parallel: false,
}) });
this._tapTests.push(localTest) if (modeArg === 'normal') {
return localTest this._tapTests.push(localTest);
} else if (modeArg === 'only') {
this._tapTestsOnly.push(localTest);
}
return localTest;
} }
/** public preTask(descriptionArg: string, functionArg: IPreTaskFunction) {
* wraps function this._tapPreTasks.push(new PreTask(descriptionArg, functionArg));
*/
wrap (functionArg: ITapWrapFunction) {
return new TapWrap(functionArg)
} }
/** /**
@ -42,71 +61,105 @@ export class Tap {
* @param testDescription - A description of what the test does * @param testDescription - A description of what the test does
* @param testFunction - A Function that returns a Promise and resolves or rejects * @param testFunction - A Function that returns a Promise and resolves or rejects
*/ */
testParallel (testDescription: string, testFunction: ITestFunction) { public testParallel(testDescription: string, testFunction: ITestFunction<T>) {
this._tapTests.push(new TapTest({ this._tapTests.push(
description: testDescription, new TapTest({
testFunction: testFunction, description: testDescription,
parallel: true testFunction,
})) parallel: true,
})
);
} }
/** /**
* starts the test evaluation * starts the test evaluation
*/ */
async start(optionsArg?: { public async start(optionsArg?: { throwOnError: boolean }) {
throwOnError: boolean // lets set the tapbundle promise
}) { const smartenvInstance = new plugins.smartenv.Smartenv();
let promiseArray: Promise<any>[] = [] smartenvInstance.isBrowser
? ((globalThis as any).tapbundleDeferred = plugins.smartpromise.defer())
: null;
// lets continue with running the tests
const promiseArray: Array<Promise<any>> = [];
// safeguard against empty test array // safeguard against empty test array
if (this._tapTests.length === 0) { if (this._tapTests.length === 0) {
console.log('no tests specified. Ending here!') console.log('no tests specified. Ending here!');
return // TODO: throw proper error
return;
} }
console.log(`1..${this._tapTests.length}`) // determine which tests to run
for (let testKey = 0; testKey < this._tapTests.length; testKey++) { let concerningTests: TapTest[];
let currentTest = this._tapTests[testKey] if (this._tapTestsOnly.length > 0) {
let testPromise = currentTest.run(testKey) concerningTests = this._tapTestsOnly;
} else {
concerningTests = this._tapTests;
}
// lets run the pretasks
for (const preTask of this._tapPreTasks) {
await preTask.run();
}
console.log(`1..${concerningTests.length}`);
for (let testKey = 0; testKey < concerningTests.length; testKey++) {
const currentTest = concerningTests[testKey];
const testPromise = currentTest.run(testKey);
if (currentTest.parallel) { if (currentTest.parallel) {
promiseArray.push(testPromise) promiseArray.push(testPromise);
} else { } else {
await testPromise await testPromise;
} }
} }
await Promise.all(promiseArray) await Promise.all(promiseArray);
// when tests have been run and all promises are fullfilled // when tests have been run and all promises are fullfilled
let failReasons: string[] = [] const failReasons: string[] = [];
let executionNotes: string[] = [] const executionNotes: string[] = [];
// collect failed tests // collect failed tests
for (let tapTest of this._tapTests) { for (const tapTest of concerningTests) {
if (tapTest.status !== 'success') { if (tapTest.status !== 'success') {
failReasons.push( failReasons.push(
`Test ${tapTest.testKey + 1} failed with status ${tapTest.status}:\n` `Test ${tapTest.testKey + 1} failed with status ${tapTest.status}:\n` +
+ `|| ${tapTest.description}\n` `|| ${tapTest.description}\n` +
+ `|| for more information please take a look the logs above` `|| for more information please take a look the logs above`
) );
} }
} }
// render fail Reasons // render fail Reasons
for (let failReason of failReasons) { for (const failReason of failReasons) {
console.log(failReason) console.log(failReason);
} }
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 as any).tapbundleDeferred.resolve();
}
}
public async stopForcefully(codeArg = 0, directArg = false) {
console.log(`tap stopping forcefully! Code: ${codeArg} / Direct: ${directArg}`);
if (directArg) {
process.exit(codeArg);
} else {
setTimeout(() => {
process.exit(codeArg);
}, 10)
} }
} }
/** /**
* handle errors * handle errors
*/ */
threw (err) { public threw(err: Error) {
console.log(err) console.log(err);
} }
} }
export let tap = new Tap() export let tap = new Tap();

View File

@ -1,80 +1,87 @@
import * as plugins from './tapbundle.plugins' import * as plugins from './tapbundle.plugins.js';
import { tapCreator } from './tapbundle.tapcreator' import { tapCreator } from './tapbundle.tapcreator.js';
import { TapTools } from './tapbundle.classes.taptools' import { TapTools } from './tapbundle.classes.taptools.js';
// imported interfaces // imported interfaces
import { HrtMeasurement } from 'early' import { Deferred } from '@push.rocks/smartpromise';
import { Deferred } from 'smartq' import { HrtMeasurement } from '@push.rocks/smarttime';
// interfaces // interfaces
export type TTestStatus = 'success' | 'error' | 'pending' | 'errorAfterSuccess' | 'timeout' export type TTestStatus = 'success' | 'error' | 'pending' | 'errorAfterSuccess' | 'timeout';
export interface ITestFunction { export interface ITestFunction<T> {
(tapTools?: TapTools): Promise<any> (tapTools?: TapTools): Promise<T>;
} }
export class TapTest<T = unknown> {
export class TapTest { public description: string;
description: string public failureAllowed: boolean;
failureAllowed: boolean public hrtMeasurement: HrtMeasurement;
hrtMeasurement: HrtMeasurement public parallel: boolean;
parallel: boolean public status: TTestStatus;
status: TTestStatus public tapTools: TapTools;
tapTools: TapTools public testFunction: ITestFunction<T>;
testFunction: ITestFunction public testKey: number; // the testKey the position in the test qeue. Set upon calling .run()
testKey: number // the testKey the position in the test qeue. Set upon calling .run() private testDeferred: Deferred<TapTest<T>> = plugins.smartpromise.defer();
testDeferred: Deferred<TapTest> = plugins.smartq.defer() public testPromise: Promise<TapTest<T>> = this.testDeferred.promise;
testPromise: Promise<TapTest> = this.testDeferred.promise private testResultDeferred: Deferred<T> = plugins.smartpromise.defer();
public testResultPromise: Promise<T> = this.testResultDeferred.promise;
/** /**
* constructor * constructor
*/ */
constructor (optionsArg: { constructor(optionsArg: {
description: string, description: string;
testFunction: ITestFunction, testFunction: ITestFunction<T>;
parallel: boolean parallel: boolean;
}) { }) {
this.description = optionsArg.description this.description = optionsArg.description;
this.hrtMeasurement = new HrtMeasurement() this.hrtMeasurement = new HrtMeasurement();
this.parallel = optionsArg.parallel this.parallel = optionsArg.parallel;
this.status = 'pending' this.status = 'pending';
this.tapTools = new TapTools(this) this.tapTools = new TapTools(this);
this.testFunction = optionsArg.testFunction this.testFunction = optionsArg.testFunction;
} }
/** /**
* run the test * run the test
*/ */
async run (testKeyArg: number) { public async run(testKeyArg: number) {
this.hrtMeasurement.start() this.hrtMeasurement.start();
this.testKey = testKeyArg this.testKey = testKeyArg;
let testNumber = testKeyArg + 1 const testNumber = testKeyArg + 1;
try { try {
await this.testFunction(this.tapTools) const testReturnValue = 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...');
} }
this.hrtMeasurement.stop() this.hrtMeasurement.stop();
console.log(`ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`) console.log(
this.status = 'success' `ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`
this.testDeferred.resolve(this) );
} catch (err) { this.status = 'success';
this.hrtMeasurement.stop() this.testDeferred.resolve(this);
console.log(`not ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`) this.testResultDeferred.resolve(testReturnValue);
this.testDeferred.resolve(this) } catch (err: any) {
this.hrtMeasurement.stop();
console.log(
`not ok ${testNumber} - ${this.description} # time=${this.hrtMeasurement.milliSeconds}ms`
);
this.testDeferred.resolve(this);
this.testResultDeferred.resolve(err);
// if the test has already succeeded before // if the test has already succeeded before
if (this.status === 'success') { if (this.status === 'success') {
this.status = 'errorAfterSuccess' this.status = 'errorAfterSuccess';
console.log('!!! ALERT !!!: weird behaviour, since test has been already successfull') console.log('!!! ALERT !!!: weird behaviour, since test has been already successfull');
} else { } else {
this.status = 'error' this.status = 'error';
} }
// if the test is allowed to fail // if the test is allowed to fail
if (this.failureAllowed) { if (this.failureAllowed) {
console.log(`please note: failure allowed!`) console.log(`please note: failure allowed!`);
} }
console.log(err) console.log(err);
} }
} }
} }

View File

@ -1,59 +1,64 @@
import * as plugins from './tapbundle.plugins' import * as plugins from './tapbundle.plugins.js';
import { TapTest } from './tapbundle.classes.taptest' import { TapTest } from './tapbundle.classes.taptest.js';
export interface IPromiseFunc { export interface IPromiseFunc {
(): Promise<any> (): Promise<any>;
} }
export class TapTools { export class TapTools {
/** /**
* the referenced TapTest * the referenced TapTest
*/ */
private _tapTest: TapTest private _tapTest: TapTest;
constructor (TapTestArg) { constructor(TapTestArg: TapTest<any>) {
this._tapTest = TapTestArg this._tapTest = TapTestArg;
} }
/** /**
* allow failure * allow failure
*/ */
allowFailure () { public allowFailure() {
this._tapTest.failureAllowed = true this._tapTest.failureAllowed = true;
} }
/** /**
* async/await delay method * async/await delay method
*/ */
async delayFor (timeMilliArg) { public async delayFor(timeMilliArg: number) {
await plugins.smartdelay.delayFor(timeMilliArg) await plugins.smartdelay.delayFor(timeMilliArg);
} }
async delayForRandom (timeMilliMinArg, timeMilliMaxArg) { public async delayForRandom(timeMilliMinArg: number, timeMilliMaxArg: number) {
await plugins.smartdelay.delayForRandom(timeMilliMinArg, timeMilliMaxArg) await plugins.smartdelay.delayForRandom(timeMilliMinArg, timeMilliMaxArg);
} }
async timeout (timeMilliArg: number) { public async coloredString(...args: Parameters<typeof plugins.consolecolor.coloredString>) {
let timeout = new plugins.smartdelay.Timeout(timeMilliArg) return plugins.consolecolor.coloredString(...args);
timeout.makeUnrefed() }
await timeout.promise
public async timeout(timeMilliArg: number) {
const timeout = new plugins.smartdelay.Timeout(timeMilliArg);
timeout.makeUnrefed();
await timeout.promise;
if (this._tapTest.status === 'pending') { if (this._tapTest.status === 'pending') {
this._tapTest.status = 'timeout' this._tapTest.status = 'timeout';
} }
} }
async checkIterationLeak (iterationfuncArg: IPromiseFunc) { public async returnError(throwingFuncArg: IPromiseFunc) {
await plugins.leakage.iterate.async(iterationfuncArg) let funcErr: Error;
}
async returnError (throwingFuncArg: IPromiseFunc) {
let funcErr: Error
try { try {
await throwingFuncArg() await throwingFuncArg();
} catch (err) { } catch (err: any) {
funcErr = err funcErr = err;
} }
return funcErr return funcErr;
} }
public defer() {
return plugins.smartpromise.defer();
}
public smartjson = plugins.smartjson;
} }

View File

@ -1,24 +1,13 @@
import * as plugins from './tapbundle.plugins' import * as plugins from './tapbundle.plugins.js';
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 () {
await this.wrapFunction()
} }
} }

View File

@ -1,11 +1,9 @@
import * as early from 'early' // pushrocks
import * as leakage from 'leakage' import * as consolecolor from '@push.rocks/consolecolor';
import * as smartdelay from 'smartdelay' import * as smartdelay from '@push.rocks/smartdelay';
import * as smartq from 'smartq' import * as smartenv from '@push.rocks/smartenv';
import * as smartexpect from '@push.rocks/smartexpect';
import * as smartjson from '@push.rocks/smartjson';
import * as smartpromise from '@push.rocks/smartpromise';
export { export { consolecolor, smartdelay, smartenv, smartexpect, smartjson, smartpromise };
early,
smartdelay,
smartq,
leakage
}

View File

@ -1,7 +1,7 @@
import * as plugins from './tapbundle.plugins' import * as plugins from './tapbundle.plugins.js';
export class TapCreator { export class TapCreator {
// TODO: // TODO:
} }
export let tapCreator = new TapCreator() export let tapCreator = new TapCreator();

25
ts/webhelpers.ts Normal file
View File

@ -0,0 +1,25 @@
import * as plugins from './tapbundle.plugins.js';
import type { fixture, html } from '@open-wc/testing';
import { tap } from './tapbundle.classes.tap.js';
class WebHelpers {
html: typeof html;
fixture: typeof fixture;
constructor() {
const smartenv = new plugins.smartenv.Smartenv();
if (smartenv.isBrowser) {
this.enable();
}
}
public enable() {
tap.preTask('enable webhelpers', async () => {
const webhelpers = await import('@open-wc/testing');
this.html = webhelpers.html;
this.fixture = webhelpers.fixture;
});
}
}
export const webhelpers = new WebHelpers();

View File

@ -0,0 +1,95 @@
import * as plugins from './plugins.js';
class TapNodeTools {
private smartshellInstance: plugins.smartshell.Smartshell;
constructor() {}
private qenv: plugins.qenv.Qenv;
public async getQenv(): Promise<plugins.qenv.Qenv> {
this.qenv = this.qenv || new plugins.qenv.Qenv('./', '.nogit/');
return this.qenv;
}
public async getEnvVarOnDemand(envVarNameArg: string): Promise<string> {
const qenv = await this.getQenv();
return qenv.getEnvVarOnDemand(envVarNameArg);
}
public async runCommand(commandArg: string): Promise<any> {
if (!this.smartshellInstance) {
this.smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash',
});
}
const result = await this.smartshellInstance.exec(commandArg);
return result;
}
public async createHttpsCert(
commonName: string = 'localhost',
allowSelfSigned: boolean = true
): Promise<{ key: string; cert: string }> {
if (allowSelfSigned) {
// set node to allow self-signed certificates
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
}
// Generate a key pair
const keys = plugins.smartcrypto.nodeForge.pki.rsa.generateKeyPair(2048);
// Create a self-signed certificate
const cert = plugins.smartcrypto.nodeForge.pki.createCertificate();
cert.publicKey = keys.publicKey;
cert.serialNumber = '01';
cert.validity.notBefore = new Date();
cert.validity.notAfter = new Date();
cert.validity.notAfter.setFullYear(cert.validity.notBefore.getFullYear() + 1);
const attrs = [
{ name: 'commonName', value: commonName },
{ name: 'countryName', value: 'US' },
{ shortName: 'ST', value: 'California' },
{ name: 'localityName', value: 'San Francisco' },
{ name: 'organizationName', value: 'My Company' },
{ shortName: 'OU', value: 'Dev' },
];
cert.setSubject(attrs);
cert.setIssuer(attrs);
// Sign the certificate with its own private key (self-signed)
cert.sign(keys.privateKey, plugins.smartcrypto.nodeForge.md.sha256.create());
// PEM encode the private key and certificate
const pemKey = plugins.smartcrypto.nodeForge.pki.privateKeyToPem(keys.privateKey);
const pemCert = plugins.smartcrypto.nodeForge.pki.certificateToPem(cert);
return {
key: pemKey,
cert: pemCert,
};
}
/**
* create and return a smartmongo instance
*/
public async createSmartmongo() {
const smartmongoMod = await import('@push.rocks/smartmongo');
const smartmongoInstance = new smartmongoMod.SmartMongo();
await smartmongoInstance.start();
return smartmongoInstance;
}
/**
* create and return a smarts3 instance
*/
public async createSmarts3() {
const smarts3Mod = await import('@push.rocks/smarts3');
const smarts3Instance = new smarts3Mod.Smarts3({
cleanSlate: true,
});
await smarts3Instance.start();
return smarts3Instance;
}
}
export const tapNodeTools = new TapNodeTools();

1
ts_node/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './classes.tapnodetools.js';

12
ts_node/plugins.ts Normal file
View File

@ -0,0 +1,12 @@
// node native
import * as crypto from 'crypto';
import * as fs from 'fs';
export { crypto,fs };
// @push.rocks scope
import * as qenv from '@push.rocks/qenv';
import * as smartcrypto from '@push.rocks/smartcrypto';
import * as smartshell from '@push.rocks/smartshell';
export { qenv, smartcrypto, smartshell };

14
tsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}

View File

@ -1,3 +0,0 @@
{
"extends": "tslint-config-standard"
}

244
yarn.lock
View File

@ -1,244 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/chai-as-promised@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.0.tgz#010b04cde78eacfb6e72bfddb3e58fe23c2e78b9"
dependencies:
"@types/chai" "*"
"@types/chai-string@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@types/chai-string/-/chai-string-1.4.0.tgz#c8b78deb9ae53e86c05a446c256138faeaff53c1"
dependencies:
"@types/chai" "*"
"@types/chai@*", "@types/chai@^4.1.2":
version "4.1.2"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.2.tgz#f1af664769cfb50af805431c407425ed619daa21"
"@types/node@^9.4.6":
version "9.4.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.6.tgz#d8176d864ee48753d053783e4e463aec86b8d82e"
ansi-256-colors@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz#910de50efcc7c09e3d82f2f87abd6b700c18818a"
array-uniq@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.2.tgz#5fcc373920775723cfd64d65c64bef53bf9eba6d"
assertion-error@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b"
beautycolor@^1.0.7:
version "1.0.11"
resolved "https://registry.yarnpkg.com/beautycolor/-/beautycolor-1.0.11.tgz#71c5568d5a7ed5c144d3a54f753ad1b08862aea5"
dependencies:
ansi-256-colors "^1.1.0"
typings-global "^1.0.14"
bindings@^1.2.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7"
chai-as-promised@^7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0"
dependencies:
check-error "^1.0.2"
chai-string@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/chai-string/-/chai-string-1.4.0.tgz#359140c051d36a4e4b1a5fc6b910152f438a8d49"
chai@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c"
dependencies:
assertion-error "^1.0.1"
check-error "^1.0.1"
deep-eql "^3.0.0"
get-func-name "^2.0.0"
pathval "^1.0.0"
type-detect "^4.0.0"
check-error@^1.0.1, check-error@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
deep-eql@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df"
dependencies:
type-detect "^4.0.0"
define-properties@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
dependencies:
foreach "^2.0.5"
object-keys "^1.0.8"
early@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/early/-/early-2.1.1.tgz#841e23254ea5dc54d8afaeee82f5ab65c00ee23c"
dependencies:
beautycolor "^1.0.7"
smartq "^1.1.1"
typings-global "^1.0.16"
es-abstract@^1.5.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864"
dependencies:
es-to-primitive "^1.1.1"
function-bind "^1.1.1"
has "^1.0.1"
is-callable "^1.1.3"
is-regex "^1.0.4"
es-to-primitive@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
dependencies:
is-callable "^1.1.1"
is-date-object "^1.0.1"
is-symbol "^1.0.1"
es6-error@^4.0.2:
version "4.1.1"
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d"
foreach@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
function-bind@^1.0.2, function-bind@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
get-func-name@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41"
has@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
dependencies:
function-bind "^1.0.2"
is-callable@^1.1.1, is-callable@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
is-date-object@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
is-regex@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
dependencies:
has "^1.0.1"
is-symbol@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
leakage@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39"
dependencies:
es6-error "^4.0.2"
left-pad "^1.1.3"
memwatch-next "^0.3.0"
minimist "^1.2.0"
pretty-bytes "^4.0.2"
left-pad@^1.1.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee"
memwatch-next@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/memwatch-next/-/memwatch-next-0.3.0.tgz#2111050f9a906e0aa2d72a4ec0f0089c78726f8f"
dependencies:
bindings "^1.2.1"
nan "^2.3.2"
minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
nan@^2.3.2:
version "2.9.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.9.2.tgz#f564d75f5f8f36a6d9456cca7a6c4fe488ab7866"
object-keys@^1.0.8:
version "1.0.11"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
object.getownpropertydescriptors@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
dependencies:
define-properties "^1.1.2"
es-abstract "^1.5.1"
pathval@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0"
pretty-bytes@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
randomstring@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/randomstring/-/randomstring-1.1.5.tgz#6df0628f75cbd5932930d9fe3ab4e956a18518c3"
dependencies:
array-uniq "1.0.2"
smartchai@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/smartchai/-/smartchai-2.0.0.tgz#8263e567fda6670315722992d425bbe9f31bd3e1"
dependencies:
"@types/chai" "^4.1.2"
"@types/chai-as-promised" "^7.1.0"
"@types/chai-string" "^1.4.0"
chai "^4.1.2"
chai-as-promised "^7.1.1"
chai-string "^1.4.0"
smartdelay@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/smartdelay/-/smartdelay-1.0.4.tgz#791c1a4ee6770494064c10b1d2d2b8e6f3105b82"
dependencies:
smartq "^1.1.1"
typings-global "^1.0.16"
smartq@^1.1.1:
version "1.1.6"
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.6.tgz#0c1ff4336d95e95b4f1fdd8ccd7e2c5a323b8412"
dependencies:
typings-global "^1.0.19"
util.promisify "^1.0.0"
type-detect@^4.0.0:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19:
version "1.0.28"
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.28.tgz#e28cc965476564cbc00e438739e0aa0735d323d4"
util.promisify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
dependencies:
define-properties "^1.1.2"
object.getownpropertydescriptors "^2.0.3"