test-install.js 705 B

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict'
  2. var test = require('tape')
  3. var install = require('../lib/install').test.install
  4. test('EACCES retry once', function (t) {
  5. t.plan(3)
  6. var fs = {}
  7. fs.stat = function (path, cb) {
  8. var err = new Error()
  9. err.code = 'EACCES'
  10. cb(err)
  11. t.ok(true);
  12. }
  13. var gyp = {}
  14. gyp.devDir = __dirname
  15. gyp.opts = {}
  16. gyp.opts.ensure = true
  17. gyp.commands = {}
  18. gyp.commands.install = function (argv, cb) {
  19. install(fs, gyp, argv, cb)
  20. }
  21. gyp.commands.remove = function (argv, cb) {
  22. cb()
  23. }
  24. gyp.commands.install([], function (err) {
  25. t.ok(true)
  26. if (/"pre" versions of node cannot be installed/.test(err.message)) {
  27. t.ok(true)
  28. t.ok(true)
  29. }
  30. })
  31. })