Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 503 Bytes

File metadata and controls

35 lines (25 loc) · 503 Bytes

Ensure test functions use t as their parameter

The convention is to have the parameter in tape's test function be named t. Most rules in eslint-plugin-tape are based on that assumption.

Fail

import test from 'tape';

test(foo => { // Incorrect name
	t.pass();
});

test((t, bar) => { // too many arguments
	t.pass();
});

test((bar, t) => { // too many arguments
	t.pass();
});

Pass

import test from 'tape';

test(() => {
	// ...
});

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