Sha256: 233831b27307133dd9901b73f70d8c7e83af93852f9c9ac7f6e3e6f15d07b7b3

Contents?: true

Size: 832 Bytes

Versions: 5

Compression:

Stored size: 832 Bytes

Contents

var test = require('tap').test
var c = require('../index.js').checkGit
var rimraf = require('rimraf')
var mkdirp = require('mkdirp')
var path = require('path')
var gitFixturePath = path.resolve(__dirname, 'out')

test('is .git repo', function (t) {
  mkdirp(gitFixturePath + '/.git', function () {
    c(gitFixturePath, function (err) {
      t.ok(err, 'error present')
      t.equal(err.code, 'EISGIT')
      t.end()
    })
  })
})

test('is not a .git repo', function (t) {
  c(__dirname, function (err) {
    t.notOk(err, 'error not present')
    t.end()
  })
})

test('non-thing', function (t) {
  c('/path/to/no/where', function (err) {
    t.notOk(err, 'non-existent path is not a .git repo')
    t.end()
  })
})

test('cleanup', function (t) {
  rimraf(gitFixturePath, function () {
    t.pass('cleanup')
    t.end()
  })
})

Version data entries

5 entries across 4 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/deps/npm/node_modules/npm-install-checks/test/check-git.js
node-compiler-0.9.0 vendor/node-v7.2.1/deps/npm/node_modules/npm-install-checks/test/check-git.js
node-compiler-0.8.0 vendor/node-v7.2.0/deps/npm/node_modules/npm-install-checks/test/check-git.js
node-compiler-0.7.0 vendor/node-v6.9.1/deps/npm/node_modules/npm-install-checks/test/check-git.js
node-compiler-0.7.0 vendor/node-v7.1.0/deps/npm/node_modules/npm-install-checks/test/check-git.js