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')
14 var fixture = new Tacks(
19 'package.json': File({
20 name: 'npm-test-platform',
22 homepage: 'http://www.youtube.com/watch?v=dQw4w9WgXcQ',
24 '!this_is_not_a_real_os',
28 '!this_is_not_a_real_cpu',
35 test('setup', function (t) {
40 test('platform', function (t) {
41 common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest)
42 function installCheckAndTest (err, code, stdout, stderr) {
45 t.is(code, 0, 'install went ok')
50 test('cleanup', function (t) {
57 fixture.create(fixturepath)
58 mkdirp.sync(modulepath)
62 fixture.remove(fixturepath)