Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 459 Bytes

test-ended.md

File metadata and controls

32 lines (21 loc) · 459 Bytes

Ensure callback tests are explicitly ended

Translations: Français

If you forget a t.end(); in test.cb() the test will hang indefinitely.

Fail

import test from 'ava';

test.cb(t => {
	t.pass();
});

Pass

import test from 'ava';

test.cb(t => {
	t.pass();
	t.end();
});

test.cb(t => {
	acceptsCallback(t.end);
});