This repository has been archived by the owner on May 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lifecycle): actually run lifecycle scripts correctly
- Loading branch information
1 parent
6e3e000
commit 7f8933e
Showing
5 changed files
with
175 additions
and
79 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# cipm currently relies on npm >5.4.0 to retrieve config | ||
before_install: | ||
- npm i -g [email protected] | ||
language: node_js | ||
sudo: false | ||
node_js: | ||
|
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
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 |
---|---|---|
|
@@ -5,6 +5,8 @@ const requireInject = require('require-inject') | |
const npmlog = require('npmlog') | ||
const childProcessFactory = require('../../lib/childProcessFactory.js') | ||
|
||
const dir = 'dir' | ||
|
||
let child | ||
const config = requireInject('../../../lib/config.js', { | ||
child_process: { | ||
|
@@ -20,7 +22,7 @@ function cleanup () { | |
test('config: errors if npm is not found', t => { | ||
cleanup() | ||
|
||
config().catch(err => { | ||
config(dir).catch(err => { | ||
t.equal(err.message, '`npm` command not found. Please ensure you have [email protected] or later installed.') | ||
t.end() | ||
}) | ||
|
@@ -31,7 +33,7 @@ test('config: errors if npm is not found', t => { | |
test('config: errors if npm config ls --json cant output json', t => { | ||
cleanup() | ||
|
||
config().catch(err => { | ||
config(dir).catch(err => { | ||
t.equal(err.message, '`npm config ls --json` failed to output json. Please ensure you have [email protected] or later installed.') | ||
t.end() | ||
}) | ||
|
@@ -47,7 +49,7 @@ test('config: errors if npm errors for any reason', t => { | |
|
||
const errorMessage = 'failed to reticulate splines' | ||
|
||
config().catch(err => { | ||
config(dir).catch(err => { | ||
t.equal(err, errorMessage) | ||
t.end() | ||
}) | ||
|
@@ -60,9 +62,11 @@ test('config: parses configs from npm', t => { | |
|
||
const expectedConfig = { a: 1, b: 2 } | ||
|
||
config().then(config => { | ||
expectedConfig.log = npmlog | ||
t.same(config, expectedConfig) | ||
config(dir).then(config => { | ||
t.same(config.config.a, expectedConfig.a) | ||
t.same(config.config.b, expectedConfig.b) | ||
t.same(config.dir, dir) | ||
t.same(config.log, npmlog) | ||
t.end() | ||
}) | ||
|
||
|