Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ava-spec
Advanced tools
Changelog
1.1.1
Readme
AVA Spec is meant to be installed next to AVA, so please follow its installation instructions first.
Then, install ava-spec
as a development dependency:
$ npm install --save-dev ava-spec
You still run tests with ava
command. The only thing that changes are tests themselves.
First of all, you can use ava-spec
as a drop-in for ava:
import test from 'ava-spec';
test('AVA Spec is 100% compatible with ava', t => {
t.is(true, true);
});
Jasmine-like DSL is supported:
import {describe} from 'ava-spec';
describe('AVA Spec', it => {
it('can look almost like jasmine', t => {
t.deepEqual([1, 2], [1, 2]);
});
it.todo('supports all chaining modifiers!');
});
Or write cucumber-like scenarios:
import {feature} from 'ava-spec';
feature('Cash withdrawal.', scenario => {
scenario('Not enough money in ATM', t => {
// Cucumber-like keywords are available
});
});
Or just group tests together:
test.serial.skip.group(test => {
test('AVA Spec can be used to just group some tests', t => {
t.not(true, false);
});
});
Last but not least you can pass groups around in fun ways:
const subject = test.describe('You');
subject('do not need to use callbacks!', t => {
t.is(2 + 2, 4);
});
Result:
- AVA Spec can be used to just group some tests
✔ AVA Spec is 100% compatible with ava
✔ AVA Spec can look almost like jasmine
- AVA Spec supports all chaining modifiers!
✔ Cash withdrawal. Not enough money in ATM
✔ You do not need to use callbacks!
4 tests passed
1 test skipped
1 test todo
AVA spec allows you to define test groups using 3 equivalent methods:
test.describe([title], implementation)
test.feature([title], implementation)
test.group([title], implementation)
title
Type: string
A group title.
implementation(ava)
Type: function
It is called by AVA Spec with modified AVA instance as so:
Currently AVA Spec doesn't support per-group hooks. It's a feature planned for 1.1.0.
Adam Stankiewicz | Become co-author! |
FAQs
Drop-in BDD helpers for AVA test runner 🌠
The npm package ava-spec receives a total of 592 weekly downloads. As such, ava-spec popularity was classified as not popular.
We found that ava-spec 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.