Skip to content

Commit

Permalink
Drop mz for util.promisify (#983)
Browse files Browse the repository at this point in the history
  • Loading branch information
malept committed Jun 20, 2019
1 parent b0b253b commit dd0f0de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -45,7 +45,6 @@
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"mz": "^2.6.0",
"nyc": "^14.0.0",
"pkg-up": "^3.0.1",
"sinon": "^7.0.0",
Expand Down
7 changes: 5 additions & 2 deletions test/_setup.js
Expand Up @@ -3,12 +3,15 @@
const common = require('../src/common')
const download = require('../src/download')
const config = require('./config.json')
const { exec } = require('mz/child_process')
const childProcess = require('child_process')
const fs = require('fs-extra')
const os = require('os')
const path = require('path')
const { promisify } = require('util')
const targets = require('../src/targets')

childProcess.exec = promisify(childProcess.exec)

function fixtureSubdir (subdir) {
return path.join(__dirname, 'fixtures', subdir)
}
Expand Down Expand Up @@ -66,7 +69,7 @@ async function npmInstallForFixture (fixture) {
return true
} else {
console.log(`Running npm install in fixtures/${fixture}...`)
return exec('npm install --no-bin-links', { cwd: fixtureDir })
return childProcess.exec('npm install --no-bin-links', { cwd: fixtureDir })
}
}

Expand Down
7 changes: 5 additions & 2 deletions test/darwin.js
@@ -1,15 +1,18 @@
'use strict'

const config = require('./config.json')
const { exec } = require('mz/child_process')
const childProcess = require('child_process')
const fs = require('fs-extra')
const mac = require('../src/mac')
const packager = require('..')
const path = require('path')
const plist = require('plist')
const { promisify } = require('util')
const test = require('ava')
const util = require('./_util')

childProcess.exec = promisify(childProcess.exec)

const darwinOpts = {
name: 'darwinTest',
dir: util.fixtureSubdir('basic'),
Expand Down Expand Up @@ -296,7 +299,7 @@ if (!(process.env.CI && process.platform === 'win32')) {
const appPath = path.join(finalPath, opts.name + '.app')
await util.assertDirectory(t, appPath, 'The expected .app directory should exist')
try {
await exec(`codesign -v ${appPath}`)
await childProcess.exec(`codesign -v ${appPath}`)
t.pass('codesign should verify successfully')
} catch (err) {
const notFound = err && err.code === 127
Expand Down

0 comments on commit dd0f0de

Please sign in to comment.