Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 1.77 KB

prefer-power-assert.md

File metadata and controls

49 lines (38 loc) · 1.77 KB

Enforce the use of the asserts that have no power-assert alternative (ava/prefer-power-assert)

🚫 This rule is disabled in the ✅ recommended config.

Translations: Français

Useful for people wanting to fully embrace the power of power-assert.

Fail

const test = require('ava');

test('foo', t => {
	t.truthy(foo);
	t.falsy(foo);
	t.true(foo === bar);
	t.false(foo === bar);
	t.is(foo, bar);
	t.not(foo, bar);
	t.regex(foo, bar);
	t.ifError(error);
});

Pass

const test = require('ava');

test('foo', t => {
	t.assert(foo === bar);
	t.deepEqual(foo, bar);
	t.notDeepEqual(foo, bar);
	t.throws(foo);
	t.notThrows(bar);
});