Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
cache: 'npm'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci

- name: Derive appropriate SHAs for base and head for nx affected commands
uses: nrwl/nx-set-shas@v4
Expand All @@ -48,7 +48,7 @@ jobs:
continue-on-error: false

- name: Clear Jest cache
run: yarn jest --clearCache
run: npx jest --clearCache

- name: Run tests on affected projects
run: npx nx affected --target=test --parallel=3 --coverage
Expand All @@ -71,11 +71,11 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci

- name: Derive appropriate SHAs for base and head for nx affected commands
uses: nrwl/nx-set-shas@v4
Expand Down
2 changes: 1 addition & 1 deletion config/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint-disable-next-line no-unused-vars
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';

Element.prototype.scrollTo = () => {};

Expand Down
32 changes: 32 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
testEnvironment: 'jest-environment-jsdom',
verbose: true,
testPathIgnorePatterns: [
'/node_modules/',
'packages/suir-component-mapper/',
'/.nx/'
],
setupFilesAfterEnv: [
'<rootDir>/config/jest.setup.js'
],
collectCoverageFrom: [
'<rootDir>/packages/**/src/**/*.js',
'<rootDir>/packages/**/src/**/*.ts',
'!<rootDir>/packages/**/src/**/*.d.ts',
'!<rootDir>/packages/react-renderer-demo/**/*.js',
'!<rootDir>/packages/suir-component-mapper/**/*.js',
'!<rootDir>/packages/**/dist',
'!<rootDir>/templates/**/*.js',
'!<rootDir>/packages/**/src/**/index.js',
'!<rootDir>/shared/**/*.js'
],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/fileMock.js',
'\\.(css|scss)$': 'identity-obj-proxy'
},
modulePathIgnorePatterns: [
'<rootDir>/templates/',
'<rootDir>/.nx/'
],
globalSetup: '<rootDir>/config/globalSetup.js'
};
Loading