From 3bc2342303973525addf3714d3daadd3d308efec Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 24 May 2018 10:34:05 -0400 Subject: Add -root flag so tests can write artifacts to tmp --- integration_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'integration_test.go') 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) }) } } -- cgit v1.2.3