diff options
author | CI <CI@example.com> | 2020-10-06 09:01:40 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-10 00:23:01 +1100 |
commit | e2ad503bdae11732d4c3a8502ecfc59c24570cb9 (patch) | |
tree | bf6fb070e94616f8f459b429d712e4061327641b /pkg/gui/gui_test.go | |
parent | 2657060aa28d88e3089686ca1ab0a6343b653b01 (diff) |
stop using snapshot just store the actual resultant repo
Diffstat (limited to 'pkg/gui/gui_test.go')
-rw-r--r-- | pkg/gui/gui_test.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/pkg/gui/gui_test.go b/pkg/gui/gui_test.go index 9f0e08fe7..3bedf739e 100644 --- a/pkg/gui/gui_test.go +++ b/pkg/gui/gui_test.go @@ -130,10 +130,9 @@ func Test(t *testing.T) { testPath := filepath.Join(rootDir, "test", "integration", test.name) actualDir := filepath.Join(testPath, "actual") + expectedDir := filepath.Join(testPath, "expected") findOrCreateDir(testPath) - snapshotPath := filepath.Join(testPath, "snapshot.txt") - prepareIntegrationTestDir(testPath) err := createFixture(rootDir, test.fixture, actualDir) @@ -144,13 +143,11 @@ func Test(t *testing.T) { actual := generateSnapshot(t, actualDir) if updateSnapshots { - err := ioutil.WriteFile(snapshotPath, []byte(actual), 0600) + err = oscommands.CopyDir(actualDir, expectedDir) assert.NoError(t, err) } - expectedBytes, err := ioutil.ReadFile(snapshotPath) - assert.NoError(t, err) - expected := string(expectedBytes) + expected := generateSnapshot(t, expectedDir) if expected == actual { t.Logf("%s: success at speed %d\n", test.name, speed) |