]> 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-all.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-all.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-all')
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-all',
21       version: '9.9.9-9',
22       homepage: 'http://www.zombo.com/',
23       os: [
24         'darwin',
25         'linux',
26         'win32',
27         'solaris',
28         'haiku',
29         'sunos',
30         'freebsd',
31         'openbsd',
32         'netbsd'
33       ],
34       cpu: [
35         'arm',
36         'mips',
37         'ia32',
38         'x64',
39         'sparc'
40       ]
41     })
42   })
43 )
44
45 test('setup', function (t) {
46   setup()
47   t.done()
48 })
49
50 test('platform-all', function (t) {
51   common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest)
52   function installCheckAndTest (err, code, stdout, stderr) {
53     if (err) throw err
54     t.is(stderr, '', 'no error messages')
55     t.is(code, 0, 'install went ok')
56     t.done()
57   }
58 })
59
60 test('cleanup', function (t) {
61   cleanup()
62   t.done()
63 })
64
65 function setup () {
66   cleanup()
67   fixture.create(fixturepath)
68   mkdirp.sync(modulepath)
69 }
70 function cleanup () {
71   fixture.remove(fixturepath)
72   rimraf.sync(basepath)
73 }