Welcome to mirror list, hosted at ThFree Co, Russian Federation.

scope-in-config.js « test « init-package-json « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 32bba16ede8aaf7108927efca8951e09834013a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var fs = require('fs')
var path = require('path')

var rimraf = require('rimraf')
var tap = require('tap')

var init = require('../')

var EXPECT = {
    name: '@scoped/test',
    version: '1.0.0',
    description: '',
    author: '',
    scripts: { test: 'echo \"Error: no test specified\" && exit 1' },
    main: 'basic.js',
    keywords: [],
    license: 'ISC'
}

tap.test('--yes with scope', function (t) {
  init(__dirname, __dirname, { yes: 'yes', scope: '@scoped' }, function (er, data) {
    if (er) throw er

    console.log('')
    t.has(data, EXPECT)
    t.end()
  })
})

tap.test('teardown', function (t) {
  rimraf.sync(path.join(__dirname, 'package.json'))
  t.end()
})