diff options
author | Rebecca Turner <me@re-becca.org> | 2015-06-15 17:52:37 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-06-26 03:27:12 +0300 |
commit | 590387147fb6889ad70abb849ede10c57f83f44f (patch) | |
tree | b8dbd62373f41c417ddb4b94b00154f99b5f9e80 | |
parent | 6db360e197ef407be181c9514ce7b8eede91d634 (diff) |
test: Make install-save-local less brittle
-rw-r--r-- | test/tap/install-save-local.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/tap/install-save-local.js b/test/tap/install-save-local.js index 33a1c613f..a9de5ba19 100644 --- a/test/tap/install-save-local.js +++ b/test/tap/install-save-local.js @@ -51,9 +51,9 @@ test('\'npm install --save ../local/path\' should save to package.json', functio t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.deepEqual( - pkgJson.dependencies, - { 'package-local-dependency': 'file:../package-local-dependency' }, + t.is(Object.keys(pkgJson.dependencies).length, 1, 'only one dep') + t.ok( + /file:.*?[/]package-local-dependency$/.test(pkgJson.dependencies['package-local-dependency']), 'local package saved correctly' ) t.end() @@ -80,9 +80,9 @@ test('\'npm install --save-dev ../local/path\' should save to package.json', fun t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.deepEqual( - pkgJson.devDependencies, - { 'package-local-dev-dependency': 'file:../package-local-dev-dependency' }, + t.is(Object.keys(pkgJson.devDependencies).length, 1, 'only one dep') + t.ok( + /file:.*?[/]package-local-dev-dependency$/.test(pkgJson.devDependencies['package-local-dev-dependency']), 'local package saved correctly' ) |