From 0014d294310e1113a2a0da2eb81337a8e9b7c6a9 Mon Sep 17 00:00:00 2001 From: Seth Holladay Date: Fri, 28 Dec 2018 19:33:15 -0500 Subject: [PATCH] Seperate not found tests --- test.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test.js b/test.js index 028bd7b..35a51c4 100644 --- a/test.js +++ b/test.js @@ -247,7 +247,7 @@ test('sync (not found, custom cwd)', t => { t.is(filePath, null); }); -test('async (custom function)', async t => { +test('async (matcher function)', async t => { const cwd = process.cwd(); t.is(await m(dir => { @@ -259,8 +259,8 @@ test('async (custom function)', async t => { return '.'; }), cwd); - t.is(await m(() => { - return Promise.resolve('foo.txt'); + t.is(await m(async () => { + return 'foo.txt'; }), path.join(cwd, 'foo.txt')); t.is(await m(() => { @@ -274,7 +274,9 @@ test('async (custom function)', async t => { t.is(await m(dir => { return (dir !== cwd) && 'foo.txt'; }), path.join(cwd, '..', 'foo.txt')); +}); +test('async (not found, matcher function)', t => { const {root} = path.parse(cwd); const visited = new Set(); t.is(await m(async dir => { @@ -289,7 +291,7 @@ test('async (custom function)', async t => { t.true(visited.has(root)); }); -test('sync (custom function)', t => { +test('sync (matcher function)', t => { const cwd = process.cwd(); t.is(m.sync(dir => { @@ -316,7 +318,10 @@ test('sync (custom function)', t => { t.is(m.sync(dir => { return (dir !== cwd) && 'foo.txt'; }), path.join(cwd, '..', 'foo.txt')); +}); +test('sync (not found, matcher function)', t => { + const cwd = process.cwd(); const {root} = path.parse(cwd); const visited = new Set(); t.is(m.sync(dir => {