• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict'
2var fs = require('fs')
3var path = require('path')
4var test = require('tap').test
5var mkdirp = require('mkdirp')
6var writeFileSync = require('fs').writeFileSync
7var common = require('../common-tap.js')
8
9var base = common.pkg
10var cycle = path.join(base, 'cycle')
11
12var cycleJSON = {
13  name: 'cycle',
14  version: '1.0.0',
15  description: '',
16  main: 'index.js',
17  scripts: {
18    test: 'echo "Error: no test specified" && exit 1'
19  },
20  dependencies: {
21    'cycle': '*'
22  },
23  author: '',
24  license: 'ISC'
25}
26
27test('setup', function (t) {
28  mkdirp.sync(path.join(cycle, 'node_modules'))
29  writeFileSync(
30    path.join(cycle, 'package.json'),
31    JSON.stringify(cycleJSON, null, 2)
32  )
33  fs.symlinkSync(cycle, path.join(cycle, 'node_modules', 'cycle'), 'junction')
34  t.end()
35})
36
37test('ls', function (t) {
38  process.chdir(cycle)
39  common.npm(['ls'], {}, function (err, code, stdout, stderr) {
40    t.ifError(err, 'installed w/o error')
41    t.is(stderr, '', 'no warnings printed to stderr')
42    t.end()
43  })
44})
45