@shopgate/pwa-unit-test 7.30.3 → 7.31.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/jest.config.js CHANGED
@@ -2,7 +2,7 @@
2
2
  module.exports = {
3
3
  testEnvironment: 'jsdom',
4
4
  silent: false,
5
- moduleFileExtensions: ['js', 'jsx', 'json', 'mjs'],
5
+ moduleFileExtensions: ['js', 'jsx', 'json', 'mjs', 'ts', 'tsx'],
6
6
  moduleNameMapper: {
7
7
  // Mock styles since they are not needed for unit tests
8
8
  '\\.(css|sass)$': '<rootDir>/__mocks__/styleMock.js',
@@ -17,7 +17,7 @@ module.exports = {
17
17
  snapshotSerializers: [
18
18
  'enzyme-to-json/serializer',
19
19
  ],
20
- testRegex: '(/__tests__/.*|(\\.|/)spec)\\.(js|jsx)?$',
20
+ testRegex: '(/__tests__/.*|(\\.|/)spec)\\.(js|jsx|ts|tsx)?$',
21
21
  testPathIgnorePatterns: [
22
22
  '/node_modules/',
23
23
  '/dist/',
@@ -32,7 +32,7 @@ module.exports = {
32
32
  'node_modules/enzyme/',
33
33
  ],
34
34
  collectCoverageFrom: [
35
- '**/*.{js,jsx}',
35
+ '**/*.{js,jsx,ts,tsx}',
36
36
  '!**/node_modules/**',
37
37
  '!**/coverage/**',
38
38
  '!.eslintrc.js',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-unit-test",
3
- "version": "7.30.3",
3
+ "version": "7.31.0-alpha.1",
4
4
  "description": "The unit tests setup for Shopgate's ENGAGE.",
5
5
  "author": "Shopgate <support@shopgate.com>",
6
6
  "license": "Apache-2.0",
package/testSetup.js CHANGED
@@ -28,3 +28,13 @@ jest.mock('@shopgate/pwa-core/classes/AppCommand');
28
28
  jest.mock('@shopgate/theme-gmd/extensions/reducers', () => null);
29
29
  jest.mock('@shopgate/theme-ios11/extensions/reducers', () => null);
30
30
 
31
+ // Mock the media provider styles to prevent failing tests
32
+ jest.mock('@shopgate/pwa-common/collections/media-providers/style', () => ({
33
+ responsiveContainer: 'responsiveContainer',
34
+ consentContainer: 'consentContainer',
35
+ consentLink: 'consentLink',
36
+ consentIcon: 'consentIcon',
37
+ }));
38
+
39
+ // Mock the useTheme hook to prevent failing tests due to missing theme object
40
+ jest.mock('@shopgate/engage/styles/theme/hooks/useTheme');