Skip to content

Commit 7d116ce

Browse files
committed
Simplify GetFile nil check for non-existent files in snapshot tests
1 parent f73f09b commit 7d116ce

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

internal/project/snapshot_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,8 @@ func TestSnapshot(t *testing.T) {
113113
snapshot, release := session.Snapshot()
114114
defer release()
115115

116-
// Test that GetFile returns nil for non-existent file (first call)
117116
handle := snapshot.GetFile("/home/projects/TS/p1/nonexistent.ts")
118-
assert.Check(t, handle == nil, "GetFile should return nil for non-existent file on first call")
119-
120-
// Test that GetFile returns nil for non-existent file (second call - triggers the cached path)
121-
handle2 := snapshot.GetFile("/home/projects/TS/p1/nonexistent.ts")
122-
assert.Check(t, handle2 == nil, "GetFile should return nil for non-existent file on second call")
117+
assert.Check(t, handle == nil, "GetFile should return nil for non-existent file")
123118

124119
// Test that ReadFile returns false for non-existent file
125120
_, ok := snapshot.ReadFile("/home/projects/TS/p1/nonexistent.ts")

0 commit comments

Comments
 (0)