summaryrefslogtreecommitdiff
path: root/integration_test.go
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-05-24 10:34:05 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-05-24 10:34:05 -0400
commit3bc2342303973525addf3714d3daadd3d308efec (patch)
tree43f70f54a32570e29ea34791e191f388db5823ed /integration_test.go
parent19ba0321b0bdd1b284015226474a6d54fe76e911 (diff)
Add -root flag so tests can write artifacts to tmp
Diffstat (limited to 'integration_test.go')
-rw-r--r--integration_test.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/integration_test.go b/integration_test.go
index a646c4553..4c525544c 100644
--- a/integration_test.go
+++ b/integration_test.go
@@ -45,7 +45,7 @@ func listTestFiles() []string {
return out
}
-func CheckOutput(t *testing.T, outFile string, denoFn string) {
+func checkOutput(t *testing.T, outFile string, denoFn string) {
outFile = path.Join("testdata", outFile)
jsFile := strings.TrimSuffix(outFile, ".out")
@@ -54,7 +54,12 @@ func CheckOutput(t *testing.T, outFile string, denoFn string) {
t.Fatal(err.Error())
}
- cmd := exec.Command(denoFn, jsFile, "--reload")
+ dir, err := ioutil.TempDir("", "TestIntegration")
+ if err != nil {
+ panic(err)
+ }
+
+ cmd := exec.Command(denoFn, "--root="+dir, jsFile)
var out bytes.Buffer
cmd.Stdout = &out
err = cmd.Run()
@@ -80,7 +85,7 @@ func TestIntegration(t *testing.T) {
outFiles := listTestFiles()
for _, outFile := range outFiles {
t.Run(outFile, func(t *testing.T) {
- CheckOutput(t, outFile, denoFn)
+ checkOutput(t, outFile, denoFn)
})
}
}