1 // the fixtures have some weird stuff that is painful
2 // to include directly in the repo for various reasons.
4 // So, unpack the fixtures with the system tar first.
6 // This means, of course, that it'll only work if you
7 // already have a tar implementation, and some of them
8 // will not properly unpack the fixtures anyway.
10 // But, since usually those tests will fail on Windows
11 // and other systems with less capable filesystems anyway,
12 // at least this way we don't cause inconveniences by
13 // merely cloning the repo or installing the package.
15 var tap = require("tap")
16 , child_process = require("child_process")
17 , rimraf = require("rimraf")
19 , path = require("path")
21 test("clean fixtures", function (t) {
22 rimraf(path.resolve(__dirname, "fixtures"), function (er) {
23 t.ifError(er, "rimraf ./fixtures/")
28 test("clean tmp", function (t) {
29 rimraf(path.resolve(__dirname, "tmp"), function (er) {
30 t.ifError(er, "rimraf ./tmp/")
35 test("extract fixtures", function (t) {
36 var c = child_process.spawn("tar"
37 ,["xzvf", "fixtures.tgz"]
40 c.stdout.on("data", errwrite)
41 c.stderr.on("data", errwrite)
42 function errwrite (chunk) {
43 process.stderr.write(chunk)
46 c.on("exit", function (code) {
47 t.equal(code, 0, "extract fixtures should exit with 0")
49 t.comment("Note, all tests from here on out will fail because of this.")