Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
deae532820 | |||
99883eab82 | |||
e27e59bbeb | |||
fa54431280 | |||
aa7c49548c | |||
8d5352d000 | |||
c3ae0bc211 | |||
0381f63b65 | |||
f1441bf123 | |||
9892085140 | |||
b6d1c3c083 | |||
6e6cfbadbd | |||
02ff220c59 | |||
035cb84442 | |||
505f624dd9 | |||
ea5fbd4637 | |||
de780538a5 | |||
28b1f0bfed | |||
72b72a9ffb | |||
be393199be | |||
7b6260bb15 | |||
2345e972d5 | |||
22c44a8cd0 | |||
bae2aebf83 | |||
5fe2358bfe | |||
280ded573d | |||
6b6a92b709 | |||
c1589c2309 | |||
271d657f2c | |||
63669ea6ff | |||
4306272f45 | |||
4378b36069 |
20
.gitignore
vendored
20
.gitignore
vendored
@ -1,4 +1,22 @@
|
|||||||
node_modules/
|
.nogit/
|
||||||
|
|
||||||
|
# artifacts
|
||||||
coverage/
|
coverage/
|
||||||
public/
|
public/
|
||||||
pages/
|
pages/
|
||||||
|
|
||||||
|
# installs
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# caches
|
||||||
|
.yarn/
|
||||||
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_web/
|
||||||
|
dist_serve/
|
||||||
|
dist_ts_web/
|
||||||
|
|
||||||
|
# custom
|
131
.gitlab-ci.yml
131
.gitlab-ci.yml
@ -1,16 +1,16 @@
|
|||||||
# gitzone standard
|
# gitzone ci_default
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .npmci_cache/
|
- .npmci_cache/
|
||||||
key: "$CI_BUILD_STAGE"
|
key: '$CI_BUILD_STAGE'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- security
|
- security
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- metadata
|
- metadata
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# security stage
|
# security stage
|
||||||
@ -18,108 +18,103 @@ stages:
|
|||||||
mirror:
|
mirror:
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci git mirror
|
- npmci git mirror
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
snyk:
|
snyk:
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
- npmci command npm install -g snyk
|
- npmci command npm install -g snyk
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --ignore-scripts
|
||||||
- npmci command snyk test
|
- npmci command snyk test
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
# ====================
|
# ====================
|
||||||
testLEGACY:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci node install legacy
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
testLTS:
|
testStable:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci node install lts
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci node install stable
|
||||||
- npmci npm test
|
- npmci npm install
|
||||||
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- priv
|
||||||
testSTABLE:
|
|
||||||
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci node install stable
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci node install stable
|
||||||
- npmci npm test
|
- npmci npm install
|
||||||
|
- npmci command npm run build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm publish
|
- npmci npm publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# metadata stage
|
# metadata stage
|
||||||
# ====================
|
# ====================
|
||||||
codequality:
|
codequality:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
image: docker:stable
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
services:
|
|
||||||
- docker:stable-dind
|
|
||||||
script:
|
script:
|
||||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
- npmci command npm install -g tslint typescript
|
||||||
- docker run
|
- npmci npm prepare
|
||||||
--env SOURCE_CODE="$PWD"
|
- npmci npm install
|
||||||
--volume "$PWD":/code
|
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
|
|
||||||
artifacts:
|
|
||||||
paths: [codeclimate.json]
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- priv
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci trigger
|
- npmci trigger
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-node:npmci
|
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g npmpage
|
- npmci node install lts
|
||||||
- npmci command npmpage
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command tsdoc
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
only:
|
only:
|
||||||
@ -127,15 +122,5 @@ pages:
|
|||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
windowsCompatibility:
|
|
||||||
image: stefanscherer/node-windows:10-build-tools
|
|
||||||
stage: metadata
|
|
||||||
script:
|
|
||||||
- npm install & npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- windows
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
15
.snyk
Normal file
15
.snyk
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
||||||
|
version: v1.12.0
|
||||||
|
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
|
||||||
|
ignore:
|
||||||
|
'npm:shelljs:20140723':
|
||||||
|
- smartdelay > typings-global > smartshell > shelljs:
|
||||||
|
reason: None given
|
||||||
|
expires: '2018-07-28T21:47:33.536Z'
|
||||||
|
- early > typings-global > smartshell > shelljs:
|
||||||
|
reason: None given
|
||||||
|
expires: '2018-07-28T21:47:33.537Z'
|
||||||
|
- early > beautycolor > typings-global > smartshell > shelljs:
|
||||||
|
reason: None given
|
||||||
|
expires: '2018-07-28T21:47:33.537Z'
|
||||||
|
patch: {}
|
87
README.md
87
README.md
@ -1,29 +1,76 @@
|
|||||||
# tapbundle
|
# @pushrocks/tapbundle
|
||||||
|
|
||||||
tap bundled for tapbuffer
|
tap bundled for tapbuffer
|
||||||
|
|
||||||
## Availabililty
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/tapbundle)
|
||||||
[](https://www.npmjs.com/package/tapbundle)
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/tapbundle)
|
||||||
[](https://GitLab.com/pushrocks/tapbundle)
|
* [github.com (source mirror)](https://github.com/pushrocks/tapbundle)
|
||||||
[](https://github.com/pushrocks/tapbundle)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/tapbundle/)
|
||||||
[](https://pushrocks.gitlab.io/tapbundle/)
|
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
|
[](https://gitlab.com/pushrocks/tapbundle/commits/master)
|
||||||
|
[](https://gitlab.com/pushrocks/tapbundle/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/@pushrocks/tapbundle)
|
||||||
|
[](https://snyk.io/test/npm/@pushrocks/tapbundle)
|
||||||
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
[](https://prettier.io/)
|
||||||
|
|
||||||
[](https://GitLab.com/pushrocks/tapbundle/commits/master)
|
## Usage
|
||||||
[](https://GitLab.com/pushrocks/tapbundle/commits/master)
|
|
||||||
[](https://www.npmjs.com/package/tapbundle)
|
|
||||||
[](https://david-dm.org/pushrocks/tapbundle)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/tapbundle/master/dependencies/npm)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/tapbundle)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](http://standardjs.com/)
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
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)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
|
||||||
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
|
|
||||||
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||||
|
|
||||||
[](https://push.rocks)
|
[](https://maintainedby.lossless.com)
|
||||||
|
@ -1,56 +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 | **©** [Lossless GmbH](https://lossless.gmbh)
|
|
||||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
|
@ -1,29 +0,0 @@
|
|||||||
# tapbundle
|
|
||||||
|
|
||||||
tap bundled for tapbuffer
|
|
||||||
|
|
||||||
## Availabililty
|
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/tapbundle)
|
|
||||||
[](https://GitLab.com/pushrocks/tapbundle)
|
|
||||||
[](https://github.com/pushrocks/tapbundle)
|
|
||||||
[](https://pushrocks.gitlab.io/tapbundle/)
|
|
||||||
|
|
||||||
## Status for master
|
|
||||||
|
|
||||||
[](https://GitLab.com/pushrocks/tapbundle/commits/master)
|
|
||||||
[](https://GitLab.com/pushrocks/tapbundle/commits/master)
|
|
||||||
[](https://www.npmjs.com/package/tapbundle)
|
|
||||||
[](https://david-dm.org/pushrocks/tapbundle)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/tapbundle/master/dependencies/npm)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/tapbundle)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](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)
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
|
@ -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 © 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
|
|
56
docs/theme/partials/footer.html
vendored
56
docs/theme/partials/footer.html
vendored
@ -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>
|
|
@ -1,7 +1,6 @@
|
|||||||
# License
|
|
||||||
|
|
||||||
**MIT License**
|
**MIT License**
|
||||||
|
|
||||||
|
Copright © 2016 Lossless GmbH
|
||||||
Copyright © 2016 - 2017 Martin Donath
|
Copyright © 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
|
@ -1,12 +1,21 @@
|
|||||||
{
|
{
|
||||||
"npmci": {
|
"npmci": {
|
||||||
"npmGlobalTools": [
|
"npmGlobalTools": [],
|
||||||
"npmts"
|
"npmAccessLevel": "public"
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"npmts": {
|
"npmts": {
|
||||||
"testConfig": {
|
"testConfig": {
|
||||||
"parallel": false
|
"parallel": false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"module": {
|
||||||
|
"githost": "gitlab.com",
|
||||||
|
"gitscope": "pushrocks",
|
||||||
|
"gitrepo": "tapbundle",
|
||||||
|
"shortDescription": "tap bundled for tapbuffer",
|
||||||
|
"npmPackagename": "@pushrocks/tapbundle",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
1879
package-lock.json
generated
1879
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
40
package.json
40
package.json
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "tapbundle",
|
"name": "@pushrocks/tapbundle",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "2.0.1",
|
"version": "3.0.14",
|
||||||
"description": "tap bundled for tapbuffer",
|
"description": "tap bundled for tapbuffer",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tsrun test/test.ts)",
|
"test": "(tstest test/)",
|
||||||
"build": "(npmts)"
|
"build": "(tsbuild)"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -20,15 +20,29 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/tapbundle#README",
|
"homepage": "https://gitlab.com/pushrocks/tapbundle#README",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"early": "^2.1.1",
|
"@pushrocks/early": "^3.0.3",
|
||||||
"leakage": "^0.4.0",
|
"@pushrocks/smartdelay": "^2.0.3",
|
||||||
"smartchai": "^2.0.1",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"smartdelay": "^1.0.4",
|
"smartchai": "^2.0.1"
|
||||||
"smartq": "^1.1.8"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsrun": "^1.0.7",
|
"@gitzone/tsbuild": "^2.1.11",
|
||||||
"@types/node": "^10.5.0",
|
"@gitzone/tsrun": "^1.2.8",
|
||||||
"randomstring": "^1.1.5"
|
"@gitzone/tstest": "^1.0.24",
|
||||||
}
|
"@types/node": "^12.7.2",
|
||||||
|
"randomstring": "^1.1.5",
|
||||||
|
"tslint": "^5.19.0",
|
||||||
|
"tslint-config-prettier": "^1.18.0"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"ts/**/*",
|
||||||
|
"ts_web/**/*",
|
||||||
|
"dist/**/*",
|
||||||
|
"dist_web/**/*",
|
||||||
|
"dist_ts_web/**/*",
|
||||||
|
"assets/**/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
import { tap, expect } from '../ts/index';
|
import { tap, expect } from '../ts/index';
|
||||||
import * as randomstring from 'randomstring';
|
import * as randomstring from 'randomstring';
|
||||||
|
|
||||||
let test1 = tap.test('my first test -> expect true to be true', async tools => {
|
const test1 = tap.test('my first test -> expect true to be true', async tools => {
|
||||||
await tools.checkIterationLeak(async () => {
|
await tools.checkIterationLeak(async () => {
|
||||||
let domain = randomstring.generate(1000);
|
const domain = randomstring.generate(1000);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
let outsideArray = [];
|
const outsideArray = [];
|
||||||
|
|
||||||
let test2 = tap.test('should throw', async tools => {
|
const test2 = tap.test('should throw', async tools => {
|
||||||
let err = await tools.returnError(async () => {
|
const err = await tools.returnError(async () => {
|
||||||
await tools.checkIterationLeak(async () => {
|
await tools.checkIterationLeak(async () => {
|
||||||
outsideArray.push(randomstring.generate(1000));
|
outsideArray.push(randomstring.generate(1000));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
expect(err).to.be.instanceof(Error);
|
expect(err).to.be.undefined;
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { tap, expect } from '../dist/index';
|
import { tap, expect } from '../ts/index';
|
||||||
|
|
||||||
let tapwrap = tap.wrap(async () => {
|
const tapwrap = tap.wrap(async () => {
|
||||||
tap.test('should do something', async () => {
|
tap.test('should do something', async () => {
|
||||||
console.log('test1');
|
console.log('test1');
|
||||||
});
|
});
|
||||||
|
12
test/test.ts
12
test/test.ts
@ -1,14 +1,14 @@
|
|||||||
import { tap, expect } from '../ts/index';
|
import { tap, expect } from '../ts/index';
|
||||||
|
|
||||||
let test1 = tap.test('my first test -> expect true to be true', async () => {
|
const test1 = tap.test('my first test -> expect true to be true', async () => {
|
||||||
return expect(true).to.be.true;
|
return expect(true).to.be.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
let test2 = tap.test('my second test', async tools => {
|
const test2 = tap.test('my second test', async tools => {
|
||||||
await tools.delayFor(1000);
|
await tools.delayFor(1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
let test3 = tap.test(
|
const test3 = tap.test(
|
||||||
'my third test -> test2 should take longer than test1 and endure at least 1000ms',
|
'my third test -> test2 should take longer than test1 and endure at least 1000ms',
|
||||||
async () => {
|
async () => {
|
||||||
expect((await test1).hrtMeasurement.milliSeconds < (await test2).hrtMeasurement.milliSeconds).to
|
expect((await test1).hrtMeasurement.milliSeconds < (await test2).hrtMeasurement.milliSeconds).to
|
||||||
@ -17,17 +17,17 @@ let test3 = tap.test(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
let test4 = tap.skip.test('my 4th test -> should fail', async tools => {
|
const test4 = tap.skip.test('my 4th test -> should fail', async tools => {
|
||||||
tools.allowFailure();
|
tools.allowFailure();
|
||||||
expect(false).to.be.true;
|
expect(false).to.be.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
let test5 = tap.test('my 5th test -> should pass in about 500ms', async tools => {
|
const test5 = tap.test('my 5th test -> should pass in about 500ms', async tools => {
|
||||||
tools.timeout(1000);
|
tools.timeout(1000);
|
||||||
await tools.delayFor(500);
|
await tools.delayFor(500);
|
||||||
});
|
});
|
||||||
|
|
||||||
let test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async tools => {
|
const test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async tools => {
|
||||||
tools.allowFailure();
|
tools.allowFailure();
|
||||||
tools.timeout(1000);
|
tools.timeout(1000);
|
||||||
await tools.delayFor(2000);
|
await tools.delayFor(2000);
|
||||||
|
@ -4,28 +4,50 @@ import { TapTest, ITestFunction } from './tapbundle.classes.taptest';
|
|||||||
import { TapWrap, ITapWrapFunction } from './tapbundle.classes.tapwrap';
|
import { TapWrap, ITapWrapFunction } from './tapbundle.classes.tapwrap';
|
||||||
export class Tap {
|
export class Tap {
|
||||||
/**
|
/**
|
||||||
* skip a test
|
* skips a test
|
||||||
|
* tests marked with tap.skip.test() are never executed
|
||||||
*/
|
*/
|
||||||
skip = {
|
skip = {
|
||||||
test: (descriptionArg: string, functionArg: ITestFunction) => {
|
test: (descriptionArg: string, functionArg: ITestFunction) => {
|
||||||
console.log(`skipped test: ${descriptionArg}`);
|
console.log(`skipped test: ${descriptionArg}`);
|
||||||
|
},
|
||||||
|
testParallel: (descriptionArg: string, functionArg: ITestFunction) => {
|
||||||
|
console.log(`skipped test: ${descriptionArg}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* only executes tests marked as ONLY
|
||||||
|
*/
|
||||||
|
only = {
|
||||||
|
test: (descriptionArg: string, testFunctionArg: ITestFunction) => {
|
||||||
|
this.test(descriptionArg, testFunctionArg, 'only');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private _tapTests: TapTest[] = [];
|
private _tapTests: TapTest[] = [];
|
||||||
|
private _tapTestsOnly: TapTest[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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) {
|
async test(
|
||||||
|
testDescription: string,
|
||||||
|
testFunction: ITestFunction,
|
||||||
|
modeArg: 'normal' | 'only' | 'skip' = 'normal'
|
||||||
|
) {
|
||||||
let localTest = new TapTest({
|
let localTest = new TapTest({
|
||||||
description: testDescription,
|
description: testDescription,
|
||||||
testFunction: testFunction,
|
testFunction: testFunction,
|
||||||
parallel: false
|
parallel: false
|
||||||
});
|
});
|
||||||
this._tapTests.push(localTest);
|
if (modeArg === 'normal') {
|
||||||
|
this._tapTests.push(localTest);
|
||||||
|
} else if (modeArg === 'only') {
|
||||||
|
this._tapTestsOnly.push(localTest);
|
||||||
|
}
|
||||||
return localTest;
|
return localTest;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,9 +85,17 @@ export class Tap {
|
|||||||
return;
|
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) {
|
||||||
|
concerningTests = this._tapTestsOnly;
|
||||||
|
} else {
|
||||||
|
concerningTests = this._tapTests;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`1..${concerningTests.length}`);
|
||||||
|
for (let testKey = 0; testKey < concerningTests.length; testKey++) {
|
||||||
|
let currentTest = concerningTests[testKey];
|
||||||
let testPromise = currentTest.run(testKey);
|
let testPromise = currentTest.run(testKey);
|
||||||
if (currentTest.parallel) {
|
if (currentTest.parallel) {
|
||||||
promiseArray.push(testPromise);
|
promiseArray.push(testPromise);
|
||||||
@ -79,7 +109,7 @@ export class Tap {
|
|||||||
let failReasons: string[] = [];
|
let failReasons: string[] = [];
|
||||||
let executionNotes: string[] = [];
|
let executionNotes: string[] = [];
|
||||||
// collect failed tests
|
// collect failed tests
|
||||||
for (let tapTest of this._tapTests) {
|
for (let 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` +
|
||||||
|
@ -3,8 +3,8 @@ import { tapCreator } from './tapbundle.tapcreator';
|
|||||||
import { TapTools } from './tapbundle.classes.taptools';
|
import { TapTools } from './tapbundle.classes.taptools';
|
||||||
|
|
||||||
// imported interfaces
|
// imported interfaces
|
||||||
import { HrtMeasurement } from 'early';
|
import { HrtMeasurement } from '@pushrocks/early';
|
||||||
import { Deferred } from 'smartq';
|
import { Deferred } from '@pushrocks/smartpromise';
|
||||||
|
|
||||||
// interfaces
|
// interfaces
|
||||||
export type TTestStatus = 'success' | 'error' | 'pending' | 'errorAfterSuccess' | 'timeout';
|
export type TTestStatus = 'success' | 'error' | 'pending' | 'errorAfterSuccess' | 'timeout';
|
||||||
@ -22,7 +22,7 @@ export class TapTest {
|
|||||||
tapTools: TapTools;
|
tapTools: TapTools;
|
||||||
testFunction: ITestFunction;
|
testFunction: ITestFunction;
|
||||||
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()
|
||||||
testDeferred: Deferred<TapTest> = plugins.smartq.defer();
|
testDeferred: Deferred<TapTest> = plugins.smartpromise.defer();
|
||||||
testPromise: Promise<TapTest> = this.testDeferred.promise;
|
testPromise: Promise<TapTest> = this.testDeferred.promise;
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
|
@ -18,23 +18,23 @@ export class TapTools {
|
|||||||
/**
|
/**
|
||||||
* 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) {
|
||||||
await plugins.smartdelay.delayFor(timeMilliArg);
|
await plugins.smartdelay.delayFor(timeMilliArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
async delayForRandom(timeMilliMinArg, timeMilliMaxArg) {
|
public async delayForRandom(timeMilliMinArg, timeMilliMaxArg) {
|
||||||
await plugins.smartdelay.delayForRandom(timeMilliMinArg, timeMilliMaxArg);
|
await plugins.smartdelay.delayForRandom(timeMilliMinArg, timeMilliMaxArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
async timeout(timeMilliArg: number) {
|
public async timeout(timeMilliArg: number) {
|
||||||
let timeout = new plugins.smartdelay.Timeout(timeMilliArg);
|
const timeout = new plugins.smartdelay.Timeout(timeMilliArg);
|
||||||
timeout.makeUnrefed();
|
timeout.makeUnrefed();
|
||||||
await timeout.promise;
|
await timeout.promise;
|
||||||
if (this._tapTest.status === 'pending') {
|
if (this._tapTest.status === 'pending') {
|
||||||
@ -42,11 +42,11 @@ export class TapTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkIterationLeak(iterationfuncArg: IPromiseFunc) {
|
public async checkIterationLeak(iterationfuncArg: IPromiseFunc) {
|
||||||
await plugins.leakage.iterate.async(iterationfuncArg);
|
console.log('iteration leakage checks disabled for now due to incompatibilities with node v12');
|
||||||
}
|
}
|
||||||
|
|
||||||
async returnError(throwingFuncArg: IPromiseFunc) {
|
public async returnError(throwingFuncArg: IPromiseFunc) {
|
||||||
let funcErr: Error;
|
let funcErr: Error;
|
||||||
try {
|
try {
|
||||||
await throwingFuncArg();
|
await throwingFuncArg();
|
||||||
@ -55,4 +55,8 @@ export class TapTools {
|
|||||||
}
|
}
|
||||||
return funcErr;
|
return funcErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public defer() {
|
||||||
|
return plugins.smartpromise.defer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import * as early from 'early';
|
// pushrocks
|
||||||
import * as leakage from 'leakage';
|
import * as early from '@pushrocks/early';
|
||||||
import * as smartdelay from 'smartdelay';
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
import * as smartq from 'smartq';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
|
|
||||||
export { early, smartdelay, smartq, leakage };
|
export { early, smartdelay, smartpromise };
|
||||||
|
|
||||||
|
// third party
|
||||||
|
/* import * as leakage from 'leakage';
|
||||||
|
|
||||||
|
export { leakage }; */
|
||||||
|
16
tslint.json
16
tslint.json
@ -1,3 +1,17 @@
|
|||||||
{
|
{
|
||||||
"extends": "tslint-config-standard"
|
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||||
|
"rules": {
|
||||||
|
"semicolon": [true, "always"],
|
||||||
|
"no-console": false,
|
||||||
|
"ordered-imports": false,
|
||||||
|
"object-literal-sort-keys": false,
|
||||||
|
"member-ordering": {
|
||||||
|
"options":{
|
||||||
|
"order": [
|
||||||
|
"static-method"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultSeverity": "warning"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user