From 6c1ddfd683dde5daf91dff974609ced9c5313cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 2 Jan 2024 19:54:39 +0100 Subject: [PATCH] ensure that luxon based tests are not os locale dependent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/github-issues/src/setupTests.ts | 4 ++++ plugins/home/src/setupTests.ts | 4 ++++ plugins/kubernetes-react/src/setupTests.ts | 4 ++++ plugins/scaffolder-backend/src/setupTests.ts | 19 +++++++++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 plugins/scaffolder-backend/src/setupTests.ts diff --git a/plugins/github-issues/src/setupTests.ts b/plugins/github-issues/src/setupTests.ts index 326d2ed212..2f91bcb7b3 100644 --- a/plugins/github-issues/src/setupTests.ts +++ b/plugins/github-issues/src/setupTests.ts @@ -13,4 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import '@testing-library/jest-dom'; +import { Settings } from 'luxon'; + +Settings.defaultLocale = 'en'; diff --git a/plugins/home/src/setupTests.ts b/plugins/home/src/setupTests.ts index 7435872609..d56608cdc8 100644 --- a/plugins/home/src/setupTests.ts +++ b/plugins/home/src/setupTests.ts @@ -13,4 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import '@testing-library/jest-dom'; +import { Settings } from 'luxon'; + +Settings.defaultLocale = 'en'; diff --git a/plugins/kubernetes-react/src/setupTests.ts b/plugins/kubernetes-react/src/setupTests.ts index 865308e634..609118cd07 100644 --- a/plugins/kubernetes-react/src/setupTests.ts +++ b/plugins/kubernetes-react/src/setupTests.ts @@ -13,4 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import '@testing-library/jest-dom'; +import { Settings } from 'luxon'; + +Settings.defaultLocale = 'en'; diff --git a/plugins/scaffolder-backend/src/setupTests.ts b/plugins/scaffolder-backend/src/setupTests.ts new file mode 100644 index 0000000000..a494d80f22 --- /dev/null +++ b/plugins/scaffolder-backend/src/setupTests.ts @@ -0,0 +1,19 @@ +/* + * Copyright 2022 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Settings } from 'luxon'; + +Settings.defaultLocale = 'en';