]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-platform.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / test / tap / legacy-platform.js
1 'use strict'
2 var test = require('tap').test
3 var common = require('../common-tap.js')
4 var path = require('path')
5 var rimraf = require('rimraf')
6 var mkdirp = require('mkdirp')
7 var basepath = path.resolve(__dirname, path.basename(__filename, '.js'))
8 var fixturepath = path.resolve(basepath, 'npm-test-platform')
9 var modulepath = path.resolve(basepath, 'node_modules')
10 var Tacks = require('tacks')
11 var File = Tacks.File
12 var Dir = Tacks.Dir
13
14 var fixture = new Tacks(
15   Dir({
16     README: File(
17       'just an npm test\n'
18     ),
19     'package.json': File({
20       name: 'npm-test-platform',
21       version: '9.9.9-9',
22       homepage: 'http://www.youtube.com/watch?v=dQw4w9WgXcQ',
23       os: [
24         '!this_is_not_a_real_os',
25         '!neither_is_this'
26       ],
27       cpu: [
28         '!this_is_not_a_real_cpu',
29         '!this_isnt_either'
30       ]
31     })
32   })
33 )
34
35 test('setup', function (t) {
36   setup()
37   t.done()
38 })
39
40 test('platform', function (t) {
41   common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest)
42   function installCheckAndTest (err, code, stdout, stderr) {
43     if (err) throw err
44     console.error(stderr)
45     t.is(code, 0, 'install went ok')
46     t.done()
47   }
48 })
49
50 test('cleanup', function (t) {
51   cleanup()
52   t.done()
53 })
54
55 function setup () {
56   cleanup()
57   fixture.create(fixturepath)
58   mkdirp.sync(modulepath)
59 }
60
61 function cleanup () {
62   fixture.remove(fixturepath)
63   rimraf.sync(basepath)
64 }