-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work around quoted batch file names fixed npm/cmd-shim#10
- Loading branch information
Showing
5 changed files
with
62 additions
and
13 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
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "runscript-with-mocha", | ||
"dependencies": { | ||
"mocha": "3.5.3" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use strict'; | ||
|
||
const assert = require('assert'); | ||
const path = require('path'); | ||
const runScript = require('runscript'); | ||
const readJSON = require('../lib/utils').readJSON; | ||
const npminstall = require('./npminstall'); | ||
const helper = require('./helper'); | ||
|
||
describe('test/runscript-with-mocha.test.js', () => { | ||
const root = helper.fixtures('runscript-with-mocha'); | ||
const cleanup = helper.cleanup(root); | ||
|
||
beforeEach(cleanup); | ||
afterEach(cleanup); | ||
|
||
it('should runscript with mocha.cmd', async () => { | ||
await npminstall({ | ||
root, | ||
}); | ||
const pkg = await readJSON(path.join(root, 'node_modules', 'mocha', 'package.json')); | ||
assert(pkg.name === 'mocha'); | ||
|
||
let mochaBin = path.join(root, 'node_modules', '.bin', 'mocha'); | ||
if (process.platform === 'win32') { | ||
mochaBin = `${mochaBin}.cmd`; | ||
} | ||
const stdio = await runScript(`${mochaBin} -V`, { stdio: 'pipe' }); | ||
assert(stdio.stdout.toString().trim() === '3.5.3'); | ||
}); | ||
}); |
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