Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Drop in replacement for mocha to abstract commonly used test setups
Install with npm:
$ npm install --save node-tdd
Drop-in replacement for mocha by simply importing describe
as below.
const expect = require('chai').expect;
const { describe } = require('node-tdd');
describe('Testing some stuff', /* { ...options }, */ () => {
it('Testing a thing', () => {
expect(3 * 7).to.equal(21);
});
});
Please see tests for further usage examples.
Type: string
The tmp directory for this test. Only available when useTmpDir
is set.
Type: object
Can be called to interact with the currently captured logs. Exposes the following functions:
get(level = null)
: Returns array of recorded logs. Can be restricted by passing in the log level.reset()
: Reset currently captured logsverbose(flag: boolean)
: Set verbosity mode of capture (if the original logger function is called)Only available when recordConsole
is set.
Type: function
Utility function that takes a function as an argument, calls it and expects it to raise an error. The raised error is returned. If not error is raised an assertion error is thrown instead.
Type: boolean
Default: false
When set to true, a fresh temporary directory is set up for each test. The directory is cleaned up after the test run has completed.
Type: boolean
Default: false
When set to true, all requests are automatically nocked. The recording files are automatically created relative to the current test file.
Type: object
Default: -
Used to declare environment variables per describe. Environment variables are also picked up from shadow files as e.g. test.spec.js.env.yml
.
To allow overwriting of environment variables prefix the name of the environment variable with ^
.
Type: number
Default: -
Set unix timestamp to freeze time to. Will modify the result of e.g. new Date()
.
Type: object
Default: -
Expects logger (e.g. console
) to be passed in and captures input,
which can be accessed by using recorder
from within the test.
Type: string
Default: -
When set, randomization is overwritten and consistent per test using the provided seed.
Type: number
Default: -
Set the timeout for all tests in the suite.
FAQs
Drop in extension for mocha to abstract commonly used test setups
The npm package node-tdd receives a total of 661 weekly downloads. As such, node-tdd popularity was classified as not popular.
We found that node-tdd demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.