source: node_modules/node-gyp/test/test-install.js@ 62b2964

finki-main main
Last change on this file since 62b2964 was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago

Initial commit

  • Property mode set to 100644
File size: 799 bytes
Line 
1'use strict'
2
3const { test } = require('tap')
4const { test: { install } } = require('../lib/install')
5const log = require('npmlog')
6
7log.level = 'error' // we expect a warning
8
9test('EACCES retry once', async (t) => {
10 t.plan(3)
11
12 const fs = {
13 promises: {
14 stat (_) {
15 const err = new Error()
16 err.code = 'EACCES'
17 t.ok(true)
18 throw err
19 }
20 }
21 }
22
23 const Gyp = {
24 devDir: __dirname,
25 opts: {
26 ensure: true
27 },
28 commands: {
29 install (argv, cb) {
30 install(fs, Gyp, argv).then(cb, cb)
31 },
32 remove (_, cb) {
33 cb()
34 }
35 }
36 }
37
38 try {
39 await install(fs, Gyp, [])
40 } catch (err) {
41 t.ok(true)
42 if (/"pre" versions of node cannot be installed/.test(err.message)) {
43 t.ok(true)
44 }
45 }
46})
Note: See TracBrowser for help on using the repository browser.