Skip to content

Commit

Permalink
Update stack trace assertions in sourcemap_test.go to improve error m…
Browse files Browse the repository at this point in the history
…essage clarity; remove "Exception|" prefix from error messages for consistency in test outputs.
  • Loading branch information
trheyi committed Dec 14, 2024
1 parent b161b13 commit e5ae01f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runtime/v8/sourcemap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 64,15 @@ func TestStackTrace(t *testing.T) {

trace := StackTrace(e, nil)
assert.NotEmpty(t, trace)
assert.Contains(t, trace, "Exception|400: Error occurred")
assert.Contains(t, trace, "400 Error occurred")
assert.Contains(t, trace, "/scripts/runtime/ts/page.ts:12:2")
assert.Contains(t, trace, "/scripts/runtime/ts/lib/bar.ts:7:2")
assert.Contains(t, trace, "/scripts/runtime/ts/lib/err.ts:8:10")

// with source root
trace = StackTrace(e, map[string]string{"/scripts": "/iscripts"})
assert.NotEmpty(t, trace)
assert.Contains(t, trace, "Exception|400: Error occurred")
assert.Contains(t, trace, "400 Error occurred")
assert.Contains(t, trace, "/iscripts/runtime/ts/page.ts:12:2")
assert.Contains(t, trace, "/iscripts/runtime/ts/lib/bar.ts:7:2")
assert.Contains(t, trace, "/iscripts/runtime/ts/lib/err.ts:8:10")
Expand All @@ -87,7 87,7 @@ func TestStackTrace(t *testing.T) {

trace = StackTrace(e, replace)
assert.NotEmpty(t, trace)
assert.Contains(t, trace, "Exception|400: Error occurred")
assert.Contains(t, trace, "400 Error occurred")
assert.Contains(t, trace, "/fscripts/runtime/ts/page.ts:12:2")
assert.Contains(t, trace, "/fscripts/runtime/ts/lib/bar.ts:7:2")
assert.Contains(t, trace, "/fscripts/runtime/ts/lib/err.ts:8:10")
Expand Down

0 comments on commit e5ae01f

Please sign in to comment.