@@ -41,7 +41,7 @@ describe("eject-dependencies", () => {
41
41
expect ( result . updatedDependencies . has ( "no-dependencies.js" ) ) . toBeFalsy ( ) ;
42
42
} ) ;
43
43
44
- it ( "updates with dest dir" , async ( ) => {
44
+ it ( "updates with destination dir" , async ( ) => {
45
45
await writeFile ( "./dest-dir.ts" , `import { readFile } from "fs-extra"` ) ;
46
46
await eject ( { destDir : "path/to/ejected" } ) ;
47
47
const destDirFile = await readFile ( "./dest-dir.ts" , "utf8" ) ;
@@ -59,8 +59,16 @@ describe("eject-dependencies", () => {
59
59
await writeFile ( "./n/e/s/t/e/d.ts" , `import { readFile } from "fs-extra"` ) ;
60
60
await eject ( { codeFiles : [ "n/e/s/**/*.ts" ] } ) ;
61
61
const destDirFile = await readFile ( "./n/e/s/t/e/d.ts" , "utf8" ) ;
62
+ expect ( destDirFile . includes ( `from "../../../../../` ) ) . toBeTruthy ( ) ;
63
+ } ) ;
64
+
65
+ it ( "updates nested file with destination dir" , async ( ) => {
66
+ await ensureDir ( "./n/e/s/t/e" ) ;
67
+ await writeFile ( "./n/e/s/t/e/dest.ts" , `import fg from "fast-glob"` ) ;
68
+ await eject ( { destDir : "path/to/" , codeFiles : [ "n/e/s/t/e/dest.ts" ] } ) ;
69
+ const destDirFile = await readFile ( "./n/e/s/t/e/dest.ts" , "utf8" ) ;
62
70
console . log ( destDirFile ) ;
63
- expect ( destDirFile . includes ( `from "../../../ ` ) ) . toBeTruthy ( ) ;
71
+ expect ( destDirFile . includes ( `from "../` ) ) . toBeTruthy ( ) ;
64
72
} ) ;
65
73
66
74
it ( "updates with dependencies filter" , async ( ) => {
@@ -77,7 +85,6 @@ describe("eject-dependencies", () => {
77
85
}
78
86
} ) ;
79
87
const filterFile = await readFile ( "./filter.ts" , "utf8" ) ;
80
- console . log ( filterFile ) ;
81
88
expect (
82
89
filterFile . includes ( `import { readFile } from "./ejected/fs-extra"` )
83
90
) . toBeTruthy ( ) ;
@@ -89,7 +96,7 @@ describe("eject-dependencies", () => {
89
96
await writeFile ( "./index.spec.ts" , originalIndexSpecTS ) ;
90
97
await ensureDir ( "./ejected" ) ;
91
98
await remove ( "./ejected" ) ;
92
- await remove ( "./path/to/ejected " ) ;
99
+ await remove ( "./path/to" ) ;
93
100
await remove ( "./no-dependencies.js" ) ;
94
101
await remove ( "./dest-dir.ts" ) ;
95
102
await remove ( "./n" ) ;
0 commit comments