-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #607 from escemi-tech/feat/upgrade-jest-28
- Loading branch information
Showing
5 changed files
with
617 additions
and
697 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { existsSync, mkdirSync } from "fs"; | ||
import { tmpdir } from "os"; | ||
import { basename, join } from "path"; | ||
|
||
import { deleteFolderRecursive } from "./file-system"; | ||
|
||
export const getTestDirPath = (dirName: string, filename: string) => | ||
join(tmpdir(), dirName + "-" + basename(filename).split(".")[0]); | ||
|
||
export function createTestDir(testDirPath: string, removeIfExists = false): string { | ||
if (existsSync(testDirPath)) { | ||
if (!removeIfExists) { | ||
return testDirPath; | ||
} | ||
deleteFolderRecursive(testDirPath); | ||
} | ||
|
||
mkdirSync(testDirPath); | ||
return testDirPath; | ||
} | ||
|
||
export function removeTestDir(testDirPath: string): void { | ||
if (!existsSync(testDirPath)) { | ||
throw new Error(`Test project dir "${testDirPath}" does not exist`); | ||
} | ||
deleteFolderRecursive(testDirPath); | ||
} |
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 |
---|---|---|
|
@@ -97,6 +97,10 @@ | |
], | ||
"collectCoverageFrom": [ | ||
"**/src/**/*.[jt]s?(x)" | ||
], | ||
"reporters": [ | ||
"default", | ||
"github-actions" | ||
] | ||
} | ||
} |
Oops, something went wrong.