Skip to content

Commit 55a04d3

Browse files
committed
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy