Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
769 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | const test = require('tap').test
|
---|
| 4 | const install = require('../lib/install').test.install
|
---|
| 5 |
|
---|
| 6 | require('npmlog').level = 'error' // we expect a warning
|
---|
| 7 |
|
---|
| 8 | test('EACCES retry once', function (t) {
|
---|
| 9 | t.plan(3)
|
---|
| 10 |
|
---|
| 11 | var fs = {}
|
---|
| 12 | fs.stat = function (path, cb) {
|
---|
| 13 | var err = new Error()
|
---|
| 14 | err.code = 'EACCES'
|
---|
| 15 | cb(err)
|
---|
| 16 | t.ok(true)
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | var gyp = {}
|
---|
| 20 | gyp.devDir = __dirname
|
---|
| 21 | gyp.opts = {}
|
---|
| 22 | gyp.opts.ensure = true
|
---|
| 23 | gyp.commands = {}
|
---|
| 24 | gyp.commands.install = function (argv, cb) {
|
---|
| 25 | install(fs, gyp, argv, cb)
|
---|
| 26 | }
|
---|
| 27 | gyp.commands.remove = function (argv, cb) {
|
---|
| 28 | cb()
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | gyp.commands.install([], function (err) {
|
---|
| 32 | t.ok(true)
|
---|
| 33 | if (/"pre" versions of node cannot be installed/.test(err.message)) {
|
---|
| 34 | t.ok(true)
|
---|
| 35 | t.ok(true)
|
---|
| 36 | }
|
---|
| 37 | })
|
---|
| 38 | })
|
---|
Note:
See
TracBrowser
for help on using the repository browser.