-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add
setup-e2e-test.ts
to avoid repeating setup codes
- Loading branch information
Showing
6 changed files
with
25 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { existsSync } from 'node:fs'; | ||
import path from 'node:path'; | ||
|
||
import { sync as spawnSync } from 'execa'; | ||
import { sync as globSync } from 'glob'; | ||
|
||
const globalSetup = async () => { | ||
const e2eFoldersToInstallDeps = globSync('e2e/*') | ||
.map((folderPath) => path.join(process.cwd(), folderPath)) | ||
.filter((folderPath) => existsSync(path.join(folderPath, 'package.json'))); | ||
|
||
e2eFoldersToInstallDeps.forEach((folderPath) => { | ||
spawnSync('yarn', ['install'], { | ||
cwd: folderPath, | ||
}); | ||
}); | ||
}; | ||
|
||
export default globalSetup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters