-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix system locale override (#7317)
Apparently setting `LC_ALL` in `vitest.setup.ts` doesn't work, as this is after the locale settings are read, but it does work in a `globalSetup` file. This can be observed locally with the Workflows tests: ``` ➜ wrangler git:(fix-test-locale) npx vitest run src/__tests__/workflows.test.ts >&/dev/null; echo $? 0 ➜ wrangler git:(fix-test-locale) git checkout origin/main vitest.config.mts && LC_ALL=en_UK npx vitest run src/__tests__/workflows.test.ts >&/dev/null; echo $? Updated 1 path from e1554242a 1 ```
- Loading branch information
Showing
3 changed files
with
8 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export function setup(): void { | ||
// Set `LC_ALL` to fix the language as English for the messages thrown by Yargs, | ||
// and to make any uses of datetimes in snapshots consistent. | ||
// This needs to be in a globalSetup script - it won't work in a setupFile script. | ||
// https://github.com/vitest-dev/vitest/issues/1575#issuecomment-1439286286 | ||
process.env.LC_ALL = "C"; | ||
} |
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