Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 356 Bytes

test-ended.md

File metadata and controls

30 lines (20 loc) · 356 Bytes

Ensure callback tests are explicitly ended

If you forget a t.end(); in a test it may hang indefinitely.

Fail

import tap from 'tap';

tap.test('some test', t => {
	t.pass();
});

Pass

import tap from 'tap';

tap.test('some test', t => {
	t.pass();
	t.end();
});

tap.test('some test', t => {
	acceptsCallback(t.end);
});