@@ -10,7 +10,6 @@ import {
1010import execa from "execa" ;
1111import fs from "fs-extra" ;
1212import path from "path" ;
13- import pathExists from "path-exists" ;
1413
1514const promptConfirmation = jest . mocked ( _promptConfirmation ) ;
1615
@@ -45,7 +44,7 @@ describe("ImportCommand", () => {
4544 await lernaImport ( testDir ) ( externalDir ) ;
4645
4746 expect ( await lastCommitInDir ( testDir ) ) . toBe ( "Init external commit" ) ;
48- expect ( await pathExists ( packageJson ) ) . toBe ( true ) ;
47+ expect ( fs . existsSync ( packageJson ) ) . toBe ( true ) ;
4948 } ) ;
5049
5150 it ( "imports a repo with conflicted merge commits when run with --flatten" , async ( ) => {
@@ -84,7 +83,7 @@ describe("ImportCommand", () => {
8483 await lernaImport ( testDir ) ( externalDir , "--flatten" ) ;
8584
8685 expect ( await lastCommitInDir ( testDir ) ) . toBe ( "Branch merged" ) ;
87- expect ( await pathExists ( newFilePath ) ) . toBe ( true ) ;
86+ expect ( fs . existsSync ( newFilePath ) ) . toBe ( true ) ;
8887 } ) ;
8988
9089 it ( "imports a repo into the root directory when packages are located there" , async ( ) => {
@@ -94,8 +93,8 @@ describe("ImportCommand", () => {
9493 await lernaImport ( testDir ) ( externalDir ) ;
9594
9695 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 ) ;
9998 } ) ;
10099
101100 it ( "supports moved files within the external repo" , async ( ) => {
@@ -108,7 +107,7 @@ describe("ImportCommand", () => {
108107 await lernaImport ( testDir ) ( externalDir ) ;
109108
110109 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 ) ;
112111 } ) ;
113112
114113 it ( "supports filepaths that have spaces within the external repo" , async ( ) =>
@@ -128,8 +127,8 @@ describe("ImportCommand", () => {
128127 }
129128
130129 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 ) ;
133132 } )
134133 ) ) ;
135134
@@ -159,8 +158,8 @@ describe("ImportCommand", () => {
159158 }
160159
161160 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 ) ;
164163 } )
165164 ) ) ;
166165
@@ -315,7 +314,7 @@ describe("ImportCommand", () => {
315314 await lernaImport ( testDir ) ( externalDir ) ;
316315
317316 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 ) ;
319318 } ) ;
320319 } ) ;
321320
@@ -330,7 +329,7 @@ describe("ImportCommand", () => {
330329 await lernaImport ( testDir ) ( externalDir ) ;
331330
332331 expect ( await lastCommitInDir ( rootDir ) ) . toBe ( "Init external commit" ) ;
333- expect ( await pathExists ( packageJson ) ) . toBe ( true ) ;
332+ expect ( fs . existsSync ( packageJson ) ) . toBe ( true ) ;
334333 } ) ;
335334 } ) ;
336335
@@ -344,7 +343,7 @@ describe("ImportCommand", () => {
344343 await lernaImport ( testDir ) ( externalDir , "--dest=packages" ) ;
345344
346345 expect ( await lastCommitInDir ( testDir ) ) . toBe ( "Init external commit" ) ;
347- expect ( await pathExists ( packageJson ) ) . toBe ( true ) ;
346+ expect ( fs . existsSync ( packageJson ) ) . toBe ( true ) ;
348347 } ) ;
349348
350349 it ( "throws error when the package directory does not match with config" , async ( ) => {
0 commit comments