Skip to content
This repository was archived by the owner on Jan 11, 2019. It is now read-only.

Commit d727529

Browse files
DrewMLsindresorhus
authored andcommitted
Use ava assertions in tests, and upgrade ava to latest version (#25)
1 parent f8637ec commit d727529

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

test/error-to-iferror.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {wrapPlugin} from './_helpers';
44

55
const wrapped = wrapPlugin(plugin);
66

7-
function tester(input, expected) {
8-
test(input, t => t.is(wrapped(input), expected));
7+
function tester(t, input, expected) {
8+
t.is(wrapped(input), expected);
99
}
1010

11-
tester('t.error(foo, bar)', 't.ifError(foo, bar)');
11+
test('error >> ifError', tester, 't.error(foo, bar)', 't.ifError(foo, bar)');

test/ok-to-truthy.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {wrapPlugin} from './_helpers';
44

55
const wrapped = wrapPlugin(plugin);
66

7-
function tester(input, expected) {
8-
test(input, t => t.is(wrapped(input), expected));
7+
function tester(t, input, expected) {
8+
t.is(wrapped(input), expected);
99
}
1010

11-
tester('t.ok(foo, bar)', 't.truthy(foo, bar)');
12-
tester('t.notOk(foo, bar)', 't.falsy(foo, bar)');
11+
test('ok >> truthy', tester, 't.ok(foo, bar)', 't.truthy(foo, bar)');
12+
test('notOk >> falsy', tester, 't.notOk(foo, bar)', 't.falsy(foo, bar)');

test/same-to-deep-equal.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import {wrapPlugin} from './_helpers';
44

55
const wrapped = wrapPlugin(plugin);
66

7-
function tester(input, expected) {
8-
test(input, t => t.is(wrapped(input), expected));
7+
function tester(t, input, expected) {
8+
t.is(wrapped(input), expected);
99
}
1010

11-
tester('t.same(foo, bar)', 't.deepEqual(foo, bar)');
12-
tester('t.notSame(foo, bar)', 't.notDeepEqual(foo, bar)');
13-
tester(`
11+
test('same >> deepEqual', tester, 't.same(foo, bar)', 't.deepEqual(foo, bar)');
12+
test('notSame >> notDeepEqual', tester, 't.notSame(foo, bar)', 't.notDeepEqual(foo, bar)');
13+
test('full test expression with same >> deepEqual', tester, `
1414
test(t => {
1515
t.same(fn.sync('1.tmp', {cwd: t.context.tmp}), [path.join(t.context.tmp, '1.tmp')]);
1616
});

0 commit comments

Comments
 (0)