@@ -4,48 +4,48 @@ const { describe, it } = require('node:test')
44const solutions = require ( './two-sum.repo' )
55
66for ( const { fun, id } of solutions ) {
7- describe ( `Leetcode 0001 'Two Sum' solution ${ id } ` , ( ) => {
8- it ( 'Solves array of length 2' , ( ) => {
7+ describe ( `Leetcode 0001 'Two Sum' solution ' ${ id } ' ` , ( ) => {
8+ it ( 'solves array of length 2' , ( ) => {
99 assert . deepEqual (
1010 fun ( [ 3 , 2 ] , 5 ) ,
1111 [ 0 , 1 ]
1212 )
1313 } )
1414
15- it ( 'Solves array of lengh 4' , ( ) => {
15+ it ( 'solves array of lengh 4' , ( ) => {
1616 assert . deepEqual (
1717 fun ( [ 4 , - 7 , 9 , 2 ] , 11 ) ,
1818 [ 2 , 3 ]
1919 )
2020 } )
2121
22- it ( 'Solves array of lengh 5' , ( ) => {
22+ it ( 'solves array of lengh 5' , ( ) => {
2323 assert . deepEqual (
2424 fun ( [ 4 , - 7 , 9 , 2 , - 5 ] , - 12 ) ,
2525 [ 1 , 4 ]
2626 )
2727 } )
2828
29- it ( 'Solves for sum of the same values' , ( ) => {
29+ it ( 'solves for sum of the same values' , ( ) => {
3030 assert . deepEqual (
3131 fun ( [ 4 , 8 , - 7 , 8 , 3 ] , 16 ) ,
3232 [ 1 , 3 ]
3333 )
3434 } )
3535
36- it ( 'Throws error if no solution is found in array of length 5' , ( ) => {
36+ it ( 'throws error if no solution is found in array of length 5' , ( ) => {
3737 assert . throws ( ( ) => fun ( [ 3 , 2 , 1 , 0 , - 1 ] , - 10 ) , Error )
3838 } )
3939
40- it ( 'Throws error if no solution is found in array of length 2' , ( ) => {
40+ it ( 'throws error if no solution is found in array of length 2' , ( ) => {
4141 assert . throws ( ( ) => fun ( [ 3 , 2 ] , 9 ) , Error )
4242 } )
4343
44- it ( 'Throws error if no solution is found in array of length 1' , ( ) => {
44+ it ( 'throws error if no solution is found in array of length 1' , ( ) => {
4545 assert . throws ( ( ) => fun ( [ 3 ] , - 6 ) , Error )
4646 } )
4747
48- it ( 'Throws error if no solution is found in array of length 0' , ( ) => {
48+ it ( 'throws error if no solution is found in array of length 0' , ( ) => {
4949 assert . throws ( ( ) => fun ( [ ] , 7 ) , Error )
5050 } )
5151 } )
0 commit comments