@@ -3,21 +3,38 @@ import { getImportPath } from "./generate.imports.utils";
33
44describe ( "Utils: generate imports" , ( ) => {
55 test ( "getImportPath" , ( ) => {
6- expect ( getImportPath ( { output : "output" , importPath : "ts" } ) ) . toEqual ( "@/data/" ) ;
7- expect ( getImportPath ( { output : "output" , importPath : "relative" } ) ) . toEqual ( "../" ) ;
8- expect ( getImportPath ( { output : "output" , importPath : "absolute" } ) ) . toEqual ( "output/" ) ;
9- expect ( getImportPath ( { output : "some-folder" , importPath : "ts" } ) ) . toEqual ( "@/data/" ) ;
10- expect ( getImportPath ( { output : "some-folder" , importPath : "relative" } ) ) . toEqual ( "../" ) ;
11- expect ( getImportPath ( { output : "some-folder" , importPath : "absolute" } ) ) . toEqual ( "some-folder/" ) ;
12- expect ( getImportPath ( { output : "src/data" , importPath : "ts" } ) ) . toEqual ( "@/data/" ) ;
13- expect ( getImportPath ( { output : "src/data" , importPath : "relative" } ) ) . toEqual ( "../" ) ;
14- expect ( getImportPath ( { output : "src/data" , importPath : "absolute" } ) ) . toEqual ( "src/data/" ) ;
15- expect ( getImportPath ( { output : "src/data/auto-gen" , importPath : "ts" } ) ) . toEqual ( "@/data/auto-gen/" ) ;
16- expect ( getImportPath ( { output : "src/data/auto-gen" , importPath : "relative" } ) ) . toEqual ( "../" ) ;
17- expect ( getImportPath ( { output : "src/data/auto-gen" , importPath : "absolute" } ) ) . toEqual ( "src/data/auto-gen/" ) ;
18- expect ( getImportPath ( { output : "frontend/src/data/auto-gen" , importPath : "ts" } ) ) . toEqual ( "@/data/auto-gen/" ) ;
19- expect ( getImportPath ( { output : "frontend/src/data/auto-gen" , importPath : "relative" } ) ) . toEqual ( "../" ) ;
20- expect ( getImportPath ( { output : "frontend/src/data/auto-gen" , importPath : "absolute" } ) ) . toEqual (
6+ expect ( getImportPath ( { output : "output" , importPath : "ts" , tsPath : "@/data" } ) ) . toEqual ( "@/data/" ) ;
7+ expect ( getImportPath ( { output : "output" , importPath : "ts" , tsPath : "@/output" } ) ) . toEqual ( "@/output/" ) ;
8+ expect ( getImportPath ( { output : "output" , importPath : "relative" , tsPath : "@/data" } ) ) . toEqual ( "../" ) ;
9+ expect ( getImportPath ( { output : "output" , importPath : "absolute" , tsPath : "@/data" } ) ) . toEqual ( "output/" ) ;
10+ expect ( getImportPath ( { output : "some-folder" , importPath : "ts" , tsPath : "@/data" } ) ) . toEqual ( "@/data/" ) ;
11+ expect ( getImportPath ( { output : "some-folder" , importPath : "ts" , tsPath : "@/output" } ) ) . toEqual ( "@/output/" ) ;
12+ expect ( getImportPath ( { output : "some-folder" , importPath : "relative" , tsPath : "@/data" } ) ) . toEqual ( "../" ) ;
13+ expect ( getImportPath ( { output : "some-folder" , importPath : "absolute" , tsPath : "@/data" } ) ) . toEqual ( "some-folder/" ) ;
14+ expect ( getImportPath ( { output : "src/data" , importPath : "ts" , tsPath : "@/data" } ) ) . toEqual ( "@/data/" ) ;
15+ expect ( getImportPath ( { output : "src/data" , importPath : "ts" , tsPath : "@/output" } ) ) . toEqual ( "@/output/" ) ;
16+ expect ( getImportPath ( { output : "src/data" , importPath : "relative" , tsPath : "@/data" } ) ) . toEqual ( "../" ) ;
17+ expect ( getImportPath ( { output : "src/data" , importPath : "absolute" , tsPath : "@/data" } ) ) . toEqual ( "src/data/" ) ;
18+ expect ( getImportPath ( { output : "src/data/auto-gen" , importPath : "ts" , tsPath : "@/data" } ) ) . toEqual (
19+ "@/data/auto-gen/" ,
20+ ) ;
21+ expect ( getImportPath ( { output : "src/data/auto-gen" , importPath : "ts" , tsPath : "@/output" } ) ) . toEqual (
22+ "@/output/auto-gen/" ,
23+ ) ;
24+ expect ( getImportPath ( { output : "src/data/auto-gen" , importPath : "relative" , tsPath : "@/data" } ) ) . toEqual ( "../" ) ;
25+ expect ( getImportPath ( { output : "src/data/auto-gen" , importPath : "absolute" , tsPath : "@/data" } ) ) . toEqual (
26+ "src/data/auto-gen/" ,
27+ ) ;
28+ expect ( getImportPath ( { output : "frontend/src/data/auto-gen" , importPath : "ts" , tsPath : "@/data" } ) ) . toEqual (
29+ "@/data/auto-gen/" ,
30+ ) ;
31+ expect ( getImportPath ( { output : "frontend/src/data/auto-gen" , importPath : "ts" , tsPath : "@/output" } ) ) . toEqual (
32+ "@/output/auto-gen/" ,
33+ ) ;
34+ expect ( getImportPath ( { output : "frontend/src/data/auto-gen" , importPath : "relative" , tsPath : "@/data" } ) ) . toEqual (
35+ "../" ,
36+ ) ;
37+ expect ( getImportPath ( { output : "frontend/src/data/auto-gen" , importPath : "absolute" , tsPath : "@/data" } ) ) . toEqual (
2138 "frontend/src/data/auto-gen/" ,
2239 ) ;
2340 } ) ;
0 commit comments