From e830c817e8375ed1ce98b75855b97af06dda7db5 Mon Sep 17 00:00:00 2001 From: Tyler Ohlsen Date: Fri, 1 Mar 2024 18:03:53 -0800 Subject: [PATCH] Move style mock under mocks/ Signed-off-by: Tyler Ohlsen --- test/jest.config.js | 4 +++- test/{style_stub.js => mocks/style_mock.ts} | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) rename test/{style_stub.js => mocks/style_mock.ts} (80%) diff --git a/test/jest.config.js b/test/jest.config.js index c854498b..91b0e142 100644 --- a/test/jest.config.js +++ b/test/jest.config.js @@ -7,8 +7,10 @@ module.exports = { rootDir: '../', roots: [''], coverageDirectory: './coverage', + // we mock any style-related files and return an empty module. This is needed due to errors + // when jest tries to interpret these types of files. moduleNameMapper: { - '\\.(css|less|scss|sass)$': '/test/style_stub.js', + '\\.(css|less|scss|sass)$': '/test/mocks/style_mock.ts', }, testEnvironment: 'jest-environment-jsdom', coverageReporters: ['lcov', 'text', 'cobertura'], diff --git a/test/style_stub.js b/test/mocks/style_mock.ts similarity index 80% rename from test/style_stub.js rename to test/mocks/style_mock.ts index 28de3c8b..acbbabcc 100644 --- a/test/style_stub.js +++ b/test/mocks/style_mock.ts @@ -3,4 +3,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -module.exports = {}; +export default {};