1
- import { shouldChunk } from "../../../indexing/chunk/chunk" ;
2
1
import path from "path" ;
2
+ import { shouldChunk } from "../../../indexing/chunk/chunk" ;
3
3
4
4
describe ( "shouldChunk" , ( ) => {
5
- test ( "should chunk a typescript file" , ( ) => {
6
- const filePath = "directory/ file.ts" ;
7
- const fileContent = generateString ( 10000 ) ;
8
- expect ( shouldChunk ( path . sep , filePath , fileContent ) ) . toBe ( true ) ;
9
- } ) ;
5
+ test ( "should chunk a typescript file" , ( ) => {
6
+ const filePath = path . join ( "directory" , " file.ts") ;
7
+ const fileContent = generateString ( 10000 ) ;
8
+ expect ( shouldChunk ( path . sep , filePath , fileContent ) ) . toBe ( true ) ;
9
+ } ) ;
10
10
11
- test ( "should not chunk a large typescript file" , ( ) => {
12
- const filePath = "directory/ file.ts" ;
13
- const fileContent = generateString ( 1500000 ) ;
14
- expect ( shouldChunk ( path . sep , filePath , fileContent ) ) . toBe ( false ) ;
15
- } ) ;
11
+ test ( "should not chunk a large typescript file" , ( ) => {
12
+ const filePath = path . join ( "directory" , " file.ts") ;
13
+ const fileContent = generateString ( 1500000 ) ;
14
+ expect ( shouldChunk ( path . sep , filePath , fileContent ) ) . toBe ( false ) ;
15
+ } ) ;
16
16
17
- test ( "should not chunk an empty file" , ( ) => {
18
- const filePath = "directory/ file.ts" ;
19
- const fileContent = generateString ( 0 ) ;
20
- expect ( shouldChunk ( path . sep , filePath , fileContent ) ) . toBe ( false ) ;
21
- } ) ;
17
+ test ( "should not chunk an empty file" , ( ) => {
18
+ const filePath = path . join ( "directory" , " file.ts") ;
19
+ const fileContent = generateString ( 0 ) ;
20
+ expect ( shouldChunk ( path . sep , filePath , fileContent ) ) . toBe ( false ) ;
21
+ } ) ;
22
22
23
- test ( "should not chunk a file without extension" , ( ) => {
24
- const filePath = "directory/ with.dot/ filename" ;
25
- const fileContent = generateString ( 10000 ) ;
26
- expect ( shouldChunk ( path . sep , filePath , fileContent ) ) . toBe ( false ) ;
27
- } ) ;
23
+ test ( "should not chunk a file without extension" , ( ) => {
24
+ const filePath = path . join ( "directory" , " with.dot" , " filename") ;
25
+ const fileContent = generateString ( 10000 ) ;
26
+ expect ( shouldChunk ( path . sep , filePath , fileContent ) ) . toBe ( false ) ;
27
+ } ) ;
28
28
} ) ;
29
29
30
30
function generateString ( length : number ) {
31
- return "a" . repeat ( length ) ;
32
- }
31
+ return "a" . repeat ( length ) ;
32
+ }
0 commit comments