Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 467 Bytes

test-ended.md

File metadata and controls

32 lines (21 loc) · 467 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

const test = require('ava');

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

Pass

const test = require('ava');

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

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