1
1
const twoSum = require ( './main' ) ;
2
2
3
- test ( 'the array of [1,2] and the parameter 3 returns [1,2 ]' , ( ) => {
4
- expect ( twoSum ( [ 1 , 2 ] , 3 ) ) . toStrictEqual ( [ 1 , 2 ] ) ;
3
+ test ( 'the array of [1,2] and the parameter 3 returns [0,1 ]' , ( ) => {
4
+ expect ( twoSum ( [ 1 , 2 ] , 3 ) ) . toStrictEqual ( [ 0 , 1 ] ) ;
5
5
} ) ;
6
6
7
- test ( 'the array of [2,2,1] and the parameter 4 returns [2,2 ]' , ( ) => {
8
- expect ( twoSum ( [ 2 , 2 , 1 ] , 4 ) ) . toStrictEqual ( [ 2 , 2 ] ) ;
7
+ test ( 'the array of [2,2,1] and the parameter 4 returns [0,1 ]' , ( ) => {
8
+ expect ( twoSum ( [ 2 , 2 , 1 ] , 4 ) ) . toStrictEqual ( [ 0 , 1 ] ) ;
9
9
} ) ;
10
10
11
- test ( 'the array of [1,5,3] and the parameter 4 returns [1,3 ]' , ( ) => {
12
- expect ( twoSum ( [ 1 , 5 , 3 ] , 4 ) ) . toStrictEqual ( [ 1 , 3 ] ) ;
11
+ test ( 'the array of [1,5,3] and the parameter 4 returns [0,2 ]' , ( ) => {
12
+ expect ( twoSum ( [ 1 , 5 , 3 ] , 4 ) ) . toStrictEqual ( [ 0 , 2 ] ) ;
13
13
} ) ;
14
14
15
- test ( 'the array of [5,3,1] and the parameter 4 returns [3,1 ]' , ( ) => {
16
- expect ( twoSum ( [ 5 , 3 , 1 ] , 4 ) ) . toStrictEqual ( [ 3 , 1 ] ) ;
15
+ test ( 'the array of [5,3,1] and the parameter 4 returns [1,2 ]' , ( ) => {
16
+ expect ( twoSum ( [ 5 , 3 , 1 ] , 4 ) ) . toStrictEqual ( [ 1 , 2 ] ) ;
17
17
} ) ;
18
18
19
- test ( 'the array of [1234,5678,9012] and the parameter 14690 returns [5678, 9012 ]' , ( ) => {
20
- expect ( twoSum ( [ 1234 , 5678 , 9012 ] , 14690 ) ) . toStrictEqual ( [ 5678 , 9012 ] ) ;
19
+ test ( 'the array of [1234,5678,9012] and the parameter 14690 returns [1, 2 ]' , ( ) => {
20
+ expect ( twoSum ( [ 1234 , 5678 , 9012 ] , 14690 ) ) . toStrictEqual ( [ 1 , 2 ] ) ;
21
21
} ) ;
22
22
23
- test ( 'the array of [1,2,3] and the parameter 4 returns [1,3 ]' , ( ) => {
24
- expect ( twoSum ( [ 1 , 2 , 3 ] , 4 ) ) . toStrictEqual ( [ 1 , 3 ] ) ;
23
+ test ( 'the array of [1,2,3] and the parameter 4 returns [0,2 ]' , ( ) => {
24
+ expect ( twoSum ( [ 1 , 2 , 3 ] , 4 ) ) . toStrictEqual ( [ 0 , 2 ] ) ;
25
25
} ) ;
0 commit comments