@@ -4,16 +4,16 @@ describe('Matrix', () => {
44 it ( 'should throw when trying to add matrices of invalid shapes' , ( ) => {
55 expect (
66 ( ) => mtrx . dot ( [ 0 ] , [ 1 ] ) ,
7- ) . toThrowError ( 'Invalid matrix format' ) ;
7+ ) . toThrow ( 'Invalid matrix format' ) ;
88 expect (
99 ( ) => mtrx . dot ( [ [ 0 ] ] , [ 1 ] ) ,
10- ) . toThrowError ( 'Invalid matrix format' ) ;
10+ ) . toThrow ( 'Invalid matrix format' ) ;
1111 expect (
1212 ( ) => mtrx . dot ( [ [ [ 0 ] ] ] , [ [ 1 ] ] ) ,
13- ) . toThrowError ( 'Matrix is not of 2D shape' ) ;
13+ ) . toThrow ( 'Matrix is not of 2D shape' ) ;
1414 expect (
1515 ( ) => mtrx . dot ( [ [ 0 ] ] , [ [ 1 ] , [ 2 ] ] ) ,
16- ) . toThrowError ( 'Matrices have incompatible shape for multiplication' ) ;
16+ ) . toThrow ( 'Matrices have incompatible shape for multiplication' ) ;
1717 } ) ;
1818
1919 it ( 'should calculate matrices dimensions' , ( ) => {
@@ -252,7 +252,7 @@ describe('Matrix', () => {
252252 it ( 'should throw when trying to transpose non 2D matrix' , ( ) => {
253253 expect ( ( ) => {
254254 mtrx . t ( [ [ [ 1 ] ] ] ) ;
255- } ) . toThrowError ( 'Matrix is not of 2D shape' ) ;
255+ } ) . toThrow ( 'Matrix is not of 2D shape' ) ;
256256 } ) ;
257257
258258 it ( 'should add two matrices' , ( ) => {
@@ -316,11 +316,11 @@ describe('Matrix', () => {
316316 } ) ;
317317
318318 it ( 'should throw when trying to add matrices of different shape' , ( ) => {
319- expect ( ( ) => mtrx . add ( [ [ 0 ] ] , [ [ [ 0 ] ] ] ) ) . toThrowError (
319+ expect ( ( ) => mtrx . add ( [ [ 0 ] ] , [ [ [ 0 ] ] ] ) ) . toThrow (
320320 'Matrices have different dimensions' ,
321321 ) ;
322322
323- expect ( ( ) => mtrx . add ( [ [ 0 ] ] , [ [ 0 , 0 ] ] ) ) . toThrowError (
323+ expect ( ( ) => mtrx . add ( [ [ 0 ] ] , [ [ 0 , 0 ] ] ) ) . toThrow (
324324 'Matrices have different shapes' ,
325325 ) ;
326326 } ) ;
@@ -380,11 +380,11 @@ describe('Matrix', () => {
380380 } ) ;
381381
382382 it ( 'should throw when trying to multiply matrices element-wise of different shape' , ( ) => {
383- expect ( ( ) => mtrx . mul ( [ [ 0 ] ] , [ [ [ 0 ] ] ] ) ) . toThrowError (
383+ expect ( ( ) => mtrx . mul ( [ [ 0 ] ] , [ [ [ 0 ] ] ] ) ) . toThrow (
384384 'Matrices have different dimensions' ,
385385 ) ;
386386
387- expect ( ( ) => mtrx . mul ( [ [ 0 ] ] , [ [ 0 , 0 ] ] ) ) . toThrowError (
387+ expect ( ( ) => mtrx . mul ( [ [ 0 ] ] , [ [ 0 , 0 ] ] ) ) . toThrow (
388388 'Matrices have different shapes' ,
389389 ) ;
390390 } ) ;
@@ -444,11 +444,11 @@ describe('Matrix', () => {
444444 } ) ;
445445
446446 it ( 'should throw when trying to subtract matrices element-wise of different shape' , ( ) => {
447- expect ( ( ) => mtrx . sub ( [ [ 0 ] ] , [ [ [ 0 ] ] ] ) ) . toThrowError (
447+ expect ( ( ) => mtrx . sub ( [ [ 0 ] ] , [ [ [ 0 ] ] ] ) ) . toThrow (
448448 'Matrices have different dimensions' ,
449449 ) ;
450450
451- expect ( ( ) => mtrx . sub ( [ [ 0 ] ] , [ [ 0 , 0 ] ] ) ) . toThrowError (
451+ expect ( ( ) => mtrx . sub ( [ [ 0 ] ] , [ [ 0 , 0 ] ] ) ) . toThrow (
452452 'Matrices have different shapes' ,
453453 ) ;
454454 } ) ;
0 commit comments