]> gerrit.simantics Code Review - simantics/district.git/blob - license.js
8d8ae93dd64f26041af55b7fb8ae7e2c6c81d28b
[simantics/district.git] / license.js
1 var test = require('tap').test
2 var init = require('../')
3 var rimraf = require('rimraf')
4 var common = require('./lib/common')
5
6 test('license', function (t) {
7   init(__dirname, '', {}, function (er, data) {
8     if (er)
9       throw er
10
11     var wanted = {
12       name: 'the-name',
13       version: '1.0.0',
14       description: '',
15       scripts: { test: 'echo "Error: no test specified" && exit 1' },
16       license: 'Apache-2.0',
17       author: '',
18       main: 'basic.js'
19     }
20     console.log('')
21     t.has(data, wanted)
22     t.end()
23   })
24   common.drive([
25     'the-name\n',
26     '\n',
27     '\n',
28     '\n',
29     '\n',
30     '\n',
31     '\n',
32     '\n',
33     'Apache\n',
34     'Apache-2.0\n',
35     'yes\n'
36   ])
37 })
38
39 test('teardown', function (t) {
40   rimraf(__dirname + '/package.json', t.end.bind(t))
41 })