@@ -10,7 +10,6 @@ import {
10
10
import execa from "execa" ;
11
11
import fs from "fs-extra" ;
12
12
import path from "path" ;
13
- import pathExists from "path-exists" ;
14
13
15
14
const promptConfirmation = jest . mocked ( _promptConfirmation ) ;
16
15
@@ -45,7 +44,7 @@ describe("ImportCommand", () => {
45
44
await lernaImport ( testDir ) ( externalDir ) ;
46
45
47
46
expect ( await lastCommitInDir ( testDir ) ) . toBe ( "Init external commit" ) ;
48
- expect ( await pathExists ( packageJson ) ) . toBe ( true ) ;
47
+ expect ( fs . existsSync ( packageJson ) ) . toBe ( true ) ;
49
48
} ) ;
50
49
51
50
it ( "imports a repo with conflicted merge commits when run with --flatten" , async ( ) => {
@@ -84,7 +83,7 @@ describe("ImportCommand", () => {
84
83
await lernaImport ( testDir ) ( externalDir , "--flatten" ) ;
85
84
86
85
expect ( await lastCommitInDir ( testDir ) ) . toBe ( "Branch merged" ) ;
87
- expect ( await pathExists ( newFilePath ) ) . toBe ( true ) ;
86
+ expect ( fs . existsSync ( newFilePath ) ) . toBe ( true ) ;
88
87
} ) ;
89
88
90
89
it ( "imports a repo into the root directory when packages are located there" , async ( ) => {
@@ -94,8 +93,8 @@ describe("ImportCommand", () => {
94
93
await lernaImport ( testDir ) ( externalDir ) ;
95
94
96
95
expect ( await lastCommitInDir ( testDir ) ) . toBe ( "myapp-foo init commit" ) ;
97
- expect ( await pathExists ( path . join ( testDir , "myapp-foo/old-file" ) ) ) . toBe ( true ) ;
98
- expect ( await pathExists ( path . join ( testDir , "myapp-foo/package.json" ) ) ) . toBe ( true ) ;
96
+ expect ( fs . existsSync ( path . join ( testDir , "myapp-foo/old-file" ) ) ) . toBe ( true ) ;
97
+ expect ( fs . existsSync ( path . join ( testDir , "myapp-foo/package.json" ) ) ) . toBe ( true ) ;
99
98
} ) ;
100
99
101
100
it ( "supports moved files within the external repo" , async ( ) => {
@@ -108,7 +107,7 @@ describe("ImportCommand", () => {
108
107
await lernaImport ( testDir ) ( externalDir ) ;
109
108
110
109
expect ( await lastCommitInDir ( testDir ) ) . toBe ( "Moved old-file to new-file" ) ;
111
- expect ( await pathExists ( newFilePath ) ) . toBe ( true ) ;
110
+ expect ( fs . existsSync ( newFilePath ) ) . toBe ( true ) ;
112
111
} ) ;
113
112
114
113
it ( "supports filepaths that have spaces within the external repo" , async ( ) =>
@@ -128,8 +127,8 @@ describe("ImportCommand", () => {
128
127
}
129
128
130
129
expect ( await lastCommitInDir ( testDir ) ) . toBe ( "Init external commit" ) ;
131
- expect ( await pathExists ( newFilePath ) ) . toBe ( true ) ;
132
- expect ( await pathExists ( newDeepFilePath ) ) . toBe ( true ) ;
130
+ expect ( fs . existsSync ( newFilePath ) ) . toBe ( true ) ;
131
+ expect ( fs . existsSync ( newDeepFilePath ) ) . toBe ( true ) ;
133
132
} )
134
133
) ) ;
135
134
@@ -159,8 +158,8 @@ describe("ImportCommand", () => {
159
158
}
160
159
161
160
expect ( await lastCommitInDir ( testDir ) ) . toBe ( "rename" ) ;
162
- expect ( await pathExists ( copyFilePath ) ) . toBe ( true ) ;
163
- expect ( await pathExists ( renameFilePath ) ) . toBe ( true ) ;
161
+ expect ( fs . existsSync ( copyFilePath ) ) . toBe ( true ) ;
162
+ expect ( fs . existsSync ( renameFilePath ) ) . toBe ( true ) ;
164
163
} )
165
164
) ) ;
166
165
@@ -315,7 +314,7 @@ describe("ImportCommand", () => {
315
314
await lernaImport ( testDir ) ( externalDir ) ;
316
315
317
316
expect ( await lastCommitInDir ( testDir ) ) . toBe ( "[ISSUE-10] Moved old-file to new-file" ) ;
318
- expect ( await pathExists ( newFilePath ) ) . toBe ( true ) ;
317
+ expect ( fs . existsSync ( newFilePath ) ) . toBe ( true ) ;
319
318
} ) ;
320
319
} ) ;
321
320
@@ -330,7 +329,7 @@ describe("ImportCommand", () => {
330
329
await lernaImport ( testDir ) ( externalDir ) ;
331
330
332
331
expect ( await lastCommitInDir ( rootDir ) ) . toBe ( "Init external commit" ) ;
333
- expect ( await pathExists ( packageJson ) ) . toBe ( true ) ;
332
+ expect ( fs . existsSync ( packageJson ) ) . toBe ( true ) ;
334
333
} ) ;
335
334
} ) ;
336
335
@@ -344,7 +343,7 @@ describe("ImportCommand", () => {
344
343
await lernaImport ( testDir ) ( externalDir , "--dest=packages" ) ;
345
344
346
345
expect ( await lastCommitInDir ( testDir ) ) . toBe ( "Init external commit" ) ;
347
- expect ( await pathExists ( packageJson ) ) . toBe ( true ) ;
346
+ expect ( fs . existsSync ( packageJson ) ) . toBe ( true ) ;
348
347
} ) ;
349
348
350
349
it ( "throws error when the package directory does not match with config" , async ( ) => {
0 commit comments