mirror of
https://github.com/electron/node-gyp.git
synced 2025-09-15 13:43:40 +02:00

In addition: * moved module.exports to the bottom * no single-line if statements * no if statements without a { * const for requires * array declarations get spaces inside [ ] * 'use strict' in all .js files PR-URL: https://github.com/nodejs/node-gyp/pull/1794 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: João Reis <reis@janeasystems.com>
38 lines
769 B
JavaScript
38 lines
769 B
JavaScript
'use strict'
|
|
|
|
const test = require('tap').test
|
|
const install = require('../lib/install').test.install
|
|
|
|
require('npmlog').level = 'error' // we expect a warning
|
|
|
|
test('EACCES retry once', function (t) {
|
|
t.plan(3)
|
|
|
|
var fs = {}
|
|
fs.stat = function (path, cb) {
|
|
var err = new Error()
|
|
err.code = 'EACCES'
|
|
cb(err)
|
|
t.ok(true)
|
|
}
|
|
|
|
var gyp = {}
|
|
gyp.devDir = __dirname
|
|
gyp.opts = {}
|
|
gyp.opts.ensure = true
|
|
gyp.commands = {}
|
|
gyp.commands.install = function (argv, cb) {
|
|
install(fs, gyp, argv, cb)
|
|
}
|
|
gyp.commands.remove = function (argv, cb) {
|
|
cb()
|
|
}
|
|
|
|
gyp.commands.install([], function (err) {
|
|
t.ok(true)
|
|
if (/"pre" versions of node cannot be installed/.test(err.message)) {
|
|
t.ok(true)
|
|
t.ok(true)
|
|
}
|
|
})
|
|
})
|