Browse Source

Fixed tests for packed binary

master
Leo Lamprecht 8 years ago
parent
commit
e5cd439383
  1. 11
      test/pack-now.js

11
test/pack-now.js

@ -5,6 +5,9 @@ const path = require('path')
const crossSpawn = require('cross-spawn')
const test = require('ava')
// Utilities
const logo = require('../src/util/output/logo')
test.serial('make binary', async t => {
if (!process.env.CI) {
t.true(true)
@ -22,7 +25,7 @@ const binary = {
}[process.platform]
const binaryPath = path.resolve(__dirname, '../packed/' + binary)
const deployHelpMessage = `To deploy, run in any directory of your choosing`
const deployHelpMessage = `${logo} now [options] <command | path>`
test.serial('packed "now help" prints deploy help message', async t => {
if (!process.env.CI) {
@ -37,8 +40,7 @@ test.serial('packed "now help" prints deploy help message', async t => {
t.true(stdout.includes(deployHelpMessage))
})
function spawn(command, args) {
return new Promise((resolve, reject) => {
const spawn = (command, args) => new Promise((resolve, reject) => {
const child = crossSpawn.spawn(command, args)
let stdout = ''
@ -56,5 +58,4 @@ function spawn(command, args) {
stdout
})
})
})
}
})

Loading…
Cancel
Save