Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 55a04d3

Browse files
fix: add error try and catch
1 parent 7f6a7b6 commit 55a04d3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎Maths/test/Determinant.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect } from 'vitest'
12
import { determinant } from '../Determinant'
23
describe('Determinant', () => {
34
const testCases = [
@@ -50,7 +51,11 @@ describe('Determinant', () => {
5051
test.each(testCases)(
5152
'Should return the determinant of the square matrix.',
5253
(matrix, expected) => {
53-
expect(determinant(matrix)).toEqual(expected)
54+
try {
55+
expect(determinant(matrix)).toEqual(expected)
56+
} catch (err) {
57+
expect(err.message).toEqual(expected)
58+
}
5459
}
5560
)
5661
})

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /