![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
tape-testcheck
Advanced tools
Readme
A Tape extension to use Testcheck with Tape.
To have access to the t.check
method, you need to extend tape with the exported
check
function.
import tape from 'tape';
import addAssertions from 'extend-tape';
import check from 'tape-testcheck';
// Add the `check` assertion
const test = addAssertions(tape, { check });
// Now you can test away
test('Something', t => {
t.check(...);
});
For convenience, the gen
and sample
methods are re-exported for usage with
your checks:
import tape from 'tape';
import addAssertions from 'extend-tape';
import check, { gen, sample } from 'tape-testcheck';
import tape from 'tape';
import addAssertions from 'extend-tape';
import check, { gen, sample } from 'tape-testcheck';
const test = addAssertions(tape, { check });
test('Something', t => {
t.check(
[gen.int],
num => typeof num === 'number',
'it works!'
);
});
# Outputs:
$ ok 1 it works!
import tape from 'tape';
import addAssertions from 'extend-tape';
import check, { gen, sample } from 'tape-testcheck';
const test = addAssertions(tape, { check });
test('Something', t => {
// with options
t.check(
[gen.int],
num => typeof num === 'number',
{ times: 10 },
'works with options'
);
});
# outputs
$ ok 1 works with options
import tape from 'tape';
import addAssertions from 'extend-tape';
import check, { gen, sample } from 'tape-testcheck';
const test = addAssertions(tape, { check });
test('Something', t => {
t.check(
[gen.int],
num => typeof num === 'string',
'it fails!'
);
});
# Outputs:
$ not ok 1 it fails!
---
operator: fail
expected: |-
{ result: true }
actual: |-
{ fail: [ 0 ], 'failing-size': 0, 'num-tests': 1, result: false, shrunk: { depth: 0, result: false, smallest: [ 0 ], 'total-nodes-visited': 0 } }
at: ...
generators
: An array of testcheck generatorspropertyFn
: The testcheck property function to runoptions
: Testcheck optionsmsg
: The message to use in the test (same as any other Tape message, e.g.
t.ok(value, msg)
Run a testcheck property on propertyFn
with the provided generators
and
options
. The msg
will be passed to the t.pass
and t.fail
methods.
FAQs
Use Testcheck with Tape test runner
The npm package tape-testcheck receives a total of 4 weekly downloads. As such, tape-testcheck popularity was classified as not popular.
We found that tape-testcheck demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.