1- import { describe , it , expect } from " vitest" ;
2- import { basicPrefixSum } from " ../BasicPrefixSum.js" ;
1+ import { describe , it , expect } from ' vitest'
2+ import { basicPrefixSum } from ' ../BasicPrefixSum.js'
33
4- describe ( " basicPrefixSum" , ( ) => {
5- it ( " computes prefix sums correctly" , ( ) => {
6- expect ( basicPrefixSum ( [ 1 , 2 , 3 , 4 ] ) ) . toEqual ( [ 1 , 3 , 6 , 10 ] ) ;
7- } ) ;
4+ describe ( ' basicPrefixSum' , ( ) => {
5+ it ( ' computes prefix sums correctly' , ( ) => {
6+ expect ( basicPrefixSum ( [ 1 , 2 , 3 , 4 ] ) ) . toEqual ( [ 1 , 3 , 6 , 10 ] )
7+ } )
88
9- it ( " returns an empty array for empty input" , ( ) => {
10- expect ( basicPrefixSum ( [ ] ) ) . toEqual ( [ ] ) ;
11- } ) ;
9+ it ( ' returns an empty array for empty input' , ( ) => {
10+ expect ( basicPrefixSum ( [ ] ) ) . toEqual ( [ ] )
11+ } )
1212
13- it ( " throws an error if input is not an array" , ( ) => {
14- expect ( ( ) => basicPrefixSum ( " abc" ) ) . toThrow ( TypeError ) ;
15- } ) ;
13+ it ( ' throws an error if input is not an array' , ( ) => {
14+ expect ( ( ) => basicPrefixSum ( ' abc' ) ) . toThrow ( TypeError )
15+ } )
1616
17- it ( " throws an error if array contains non-numeric elements" , ( ) => {
18- expect ( ( ) => basicPrefixSum ( [ 1 , "2" , 3 ] ) ) . toThrow ( TypeError ) ;
19- } ) ;
20- } ) ;
17+ it ( ' throws an error if array contains non-numeric elements' , ( ) => {
18+ expect ( ( ) => basicPrefixSum ( [ 1 , '2' , 3 ] ) ) . toThrow ( TypeError )
19+ } )
20+ } )
0 commit comments