mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-03-31 22:22:14 +02:00
stop using snapshot just store the actual resultant repo
This commit is contained in:
parent
2657060aa2
commit
e2ad503bda
@ -130,10 +130,9 @@ func Test(t *testing.T) {
|
|||||||
|
|
||||||
testPath := filepath.Join(rootDir, "test", "integration", test.name)
|
testPath := filepath.Join(rootDir, "test", "integration", test.name)
|
||||||
actualDir := filepath.Join(testPath, "actual")
|
actualDir := filepath.Join(testPath, "actual")
|
||||||
|
expectedDir := filepath.Join(testPath, "expected")
|
||||||
findOrCreateDir(testPath)
|
findOrCreateDir(testPath)
|
||||||
|
|
||||||
snapshotPath := filepath.Join(testPath, "snapshot.txt")
|
|
||||||
|
|
||||||
prepareIntegrationTestDir(testPath)
|
prepareIntegrationTestDir(testPath)
|
||||||
|
|
||||||
err := createFixture(rootDir, test.fixture, actualDir)
|
err := createFixture(rootDir, test.fixture, actualDir)
|
||||||
@ -144,13 +143,11 @@ func Test(t *testing.T) {
|
|||||||
actual := generateSnapshot(t, actualDir)
|
actual := generateSnapshot(t, actualDir)
|
||||||
|
|
||||||
if updateSnapshots {
|
if updateSnapshots {
|
||||||
err := ioutil.WriteFile(snapshotPath, []byte(actual), 0600)
|
err = oscommands.CopyDir(actualDir, expectedDir)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
expectedBytes, err := ioutil.ReadFile(snapshotPath)
|
expected := generateSnapshot(t, expectedDir)
|
||||||
assert.NoError(t, err)
|
|
||||||
expected := string(expectedBytes)
|
|
||||||
|
|
||||||
if expected == actual {
|
if expected == actual {
|
||||||
t.Logf("%s: success at speed %d\n", test.name, speed)
|
t.Logf("%s: success at speed %d\n", test.name, speed)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user