Skip to content

Commit

Permalink
test: Ensure time zone dependent tests run identically across environ…
Browse files Browse the repository at this point in the history
…ments

Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Nov 5, 2024
1 parent f82f46c commit 73dbac7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/test-global-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

export const setup = () => {
process.env.TZ = 'UTC'

Check warning on line 7 in lib/test-global-setup.ts

View check run for this annotation

Codecov / codecov/patch

lib/test-global-setup.ts#L6-L7

Added lines #L6 - L7 were not covered by tests
}
1 change: 1 addition & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default async (env) => {
provider: 'istanbul',
reporter: ['lcov', 'text'],
},
globalSetup: 'lib/test-global-setup.ts',
}
delete cfg.define
return cfg
Expand Down

0 comments on commit 73dbac7

Please sign in to comment.