Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 625 Bytes

use-t.md

File metadata and controls

37 lines (26 loc) · 625 Bytes

Ensure test functions use t as their parameter

Translations: Français

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

Fail

import test from 'ava';

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 'ava';

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

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