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 {};