-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
DEVPROD-6247: Use Vitest for Parsley (#122)
- Loading branch information
Showing
125 changed files
with
3,753 additions
and
3,723 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,4 +167,5 @@ functions: | |
command: attach.xunit_results | ||
params: | ||
files: | ||
- "./ui/bin/vite/*.xml" | ||
- "./ui/bin/jest/*.xml" |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
// jest-dom adds custom jest matchers for asserting on DOM nodes. Works for vitest too! | ||
import "@testing-library/jest-dom"; | ||
|
||
// The following two variables are dummy values used in auth.test.tsx. | ||
process.env.REACT_APP_EVERGREEN_URL = "http://test-evergreen.com"; | ||
process.env.REACT_APP_GRAPHQL_URL = "http://test-graphql.com"; | ||
process.env.REACT_APP_SPRUCE_URL = "http://test-spruce.com"; | ||
|
||
if (process.env.CI) { | ||
// Avoid printing debug statements when running tests. | ||
vi.spyOn(console, "debug").mockImplementation(() => {}); | ||
|
||
// Avoid printing error statements when running tests. | ||
vi.spyOn(console, "error").mockImplementation(() => {}); | ||
|
||
// Avoid printing analytics events when running tests, but print any other console.log statements. | ||
const consoleLog = console.log; | ||
console.log = (message: string) => { | ||
if (message.startsWith("ANALYTICS EVENT")) { | ||
return; | ||
} | ||
consoleLog(message); | ||
}; | ||
} | ||
|
||
// Workaround for a bug in @testing-library/react. | ||
// It prevents Vitest's fake timers from functioning with user-event. | ||
// https://github.com/testing-library/react-testing-library/issues/1197 | ||
globalThis.jest = { | ||
...globalThis.jest, | ||
advanceTimersByTime: vi.advanceTimersByTime.bind(vi), | ||
}; |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.