mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
set Timezone Europe/Berlin
in unit tests (#3087)
needed for new formatTime unit tests. Avoiding ugly TZ setting in github workflows, see https://github.com/MichMich/MagicMirror/pull/3073
This commit is contained in:
parent
32192d1698
commit
09f117c3d9
6
.github/workflows/automated-tests.yaml
vendored
6
.github/workflows/automated-tests.yaml
vendored
@ -22,12 +22,6 @@ jobs:
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@v3
|
||||
- name: "Set timezone"
|
||||
uses: szenius/set-timezone@v1.2
|
||||
with:
|
||||
timezoneLinux: "Europe/Berlin"
|
||||
timezoneMacos: "Europe/Berlin"
|
||||
timezoneWindows: "Europe/Berlin"
|
||||
- name: "Use Node.js ${{ matrix.node-version }}"
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
|
6
.github/workflows/codecov-test-suites.yaml
vendored
6
.github/workflows/codecov-test-suites.yaml
vendored
@ -19,12 +19,6 @@ jobs:
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@v3
|
||||
- name: "Set timezone"
|
||||
uses: szenius/set-timezone@v1.2
|
||||
with:
|
||||
timezoneLinux: "Europe/Berlin"
|
||||
timezoneMacos: "Europe/Berlin"
|
||||
timezoneWindows: "Europe/Berlin"
|
||||
- name: "Install dependencies and run coverage"
|
||||
run: |
|
||||
Xvfb :99 -screen 0 1024x768x16 &
|
||||
|
@ -12,6 +12,7 @@ _This release is scheduled to be released on 2023-07-01._
|
||||
### Added
|
||||
|
||||
- Added tests for severonly
|
||||
- Set Timezone `Europe/Berlin` in unit tests (needed for new formatTime tests)
|
||||
|
||||
### Removed
|
||||
|
||||
|
@ -6,23 +6,24 @@ module.exports = async () => {
|
||||
projects: [
|
||||
{
|
||||
displayName: "unit",
|
||||
globalSetup: "<rootDir>/tests/unit/helpers/global-setup.js",
|
||||
moduleNameMapper: {
|
||||
logger: "<rootDir>/js/logger.js"
|
||||
},
|
||||
testMatch: ["**/tests/unit/**/*.[jt]s?(x)"],
|
||||
testPathIgnorePatterns: ["<rootDir>/tests/unit/mocks"]
|
||||
testPathIgnorePatterns: ["<rootDir>/tests/unit/mocks", "<rootDir>/tests/unit/helpers"]
|
||||
},
|
||||
{
|
||||
displayName: "electron",
|
||||
testMatch: ["**/tests/electron/**/*.[jt]s?(x)"],
|
||||
testPathIgnorePatterns: ["<rootDir>/tests/electron/helpers/"]
|
||||
testPathIgnorePatterns: ["<rootDir>/tests/electron/helpers"]
|
||||
},
|
||||
{
|
||||
displayName: "e2e",
|
||||
setupFilesAfterEnv: ["<rootDir>/tests/e2e/helpers/mock-console.js"],
|
||||
testMatch: ["**/tests/e2e/**/*.[jt]s?(x)"],
|
||||
modulePaths: ["<rootDir>/js/"],
|
||||
testPathIgnorePatterns: ["<rootDir>/tests/e2e/helpers/", "<rootDir>/tests/e2e/mocks"]
|
||||
testPathIgnorePatterns: ["<rootDir>/tests/e2e/helpers", "<rootDir>/tests/e2e/mocks"]
|
||||
}
|
||||
],
|
||||
collectCoverageFrom: ["./clientonly/**/*.js", "./js/**/*.js", "./modules/default/**/*.js", "./serveronly/**/*.js"],
|
||||
|
3
tests/unit/helpers/global-setup.js
Normal file
3
tests/unit/helpers/global-setup.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = async () => {
|
||||
process.env.TZ = "Europe/Berlin";
|
||||
};
|
@ -116,7 +116,6 @@ describe("Default modules utils tests", () => {
|
||||
|
||||
beforeAll(() => {
|
||||
jest.useFakeTimers();
|
||||
moment.tz.setDefault("Europe/Berlin");
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user