Skip to content

Commit

Permalink
ci: add log
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Nov 5, 2024
1 parent 7f9abde commit 19156fe
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions tests/exception.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,8 @@ test.group('Exception', () => {
try {
throw new Exception('Some message')
} catch (error) {
expect(error.stack.split('\n')[1]).toMatch(new RegExp(fileURLToPath(import.meta.url)))
}
})

test('point stack trace to correct file with a sub-class', ({ expect }) => {
expect.assertions(1)

class UserNotFound extends Exception {
static message = 'Unable to find user'
static status = 404
}

try {
throw new UserNotFound(UserNotFound.message)
} catch (error) {
console.log(import.meta.url)
console.log(error.stack)
expect(error.stack.split('\n')[1]).toMatch(new RegExp(fileURLToPath(import.meta.url)))
}
})
Expand Down

0 comments on commit 19156fe

Please sign in to comment.