-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bb0a79
commit 4412fe2
Showing
4 changed files
with
31 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ language: node_js | |
node_js: | ||
- '10' | ||
- '8' | ||
- '6' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
import path from 'path'; | ||
import test from 'ava'; | ||
import m from '.'; | ||
import readPkgUp from '.'; | ||
|
||
const cwd = 'fixture'; | ||
const pkgPath = path.resolve('.', 'package.json'); | ||
|
||
test('async', async t => { | ||
const x = await m({cwd}); | ||
t.is(x.pkg.name, 'read-pkg-up'); | ||
t.is(x.path, pkgPath); | ||
const result = await readPkgUp({cwd}); | ||
t.is(result.pkg.name, 'read-pkg-up'); | ||
t.is(result.path, pkgPath); | ||
|
||
const y = await m({cwd: '/'}); | ||
t.is(y.pkg, undefined); | ||
t.is(y.path, undefined); | ||
const result2 = await readPkgUp({cwd: '/'}); | ||
t.is(result2.pkg, undefined); | ||
t.is(result2.path, undefined); | ||
}); | ||
|
||
test('sync', t => { | ||
const x = m.sync({cwd}); | ||
t.is(x.pkg.name, 'read-pkg-up'); | ||
t.is(x.path, pkgPath); | ||
const result = readPkgUp.sync({cwd}); | ||
t.is(result.pkg.name, 'read-pkg-up'); | ||
t.is(result.path, pkgPath); | ||
|
||
const y = m.sync({cwd: '/'}); | ||
t.is(y.pkg, undefined); | ||
t.is(y.path, undefined); | ||
const result2 = readPkgUp.sync({cwd: '/'}); | ||
t.is(result2.pkg, undefined); | ||
t.is(result2.path, undefined); | ||
}); |