Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce common preset for Jest test configuration #1411

Merged
merged 7 commits into from
May 22, 2024

Conversation

literat
Copy link
Collaborator

@literat literat commented May 15, 2024

Description

We are repeating a lot of configuration for our tooling. There is a way to create presets for Jest and other tools. This is a first try that should present the preset for Jest, which can be used by all packages.

There will be some future steps that will introduce the usage of setup files and general mocking. This PR is now moving the most common configurations into the preset. It tries not to break everything.

There is also a move of the jest.config file from the config directory to the root of each package. Please consider if this is a good approach, but it seems to me, that all packages across the JS-verse are now adopting the similar naming of the configuration file and that is *.config.{js, ts, mjs, cjs}. Actually, I think it is a good move but what I am missing now are the files starting with the dot ., because they are naturally sorted by name, and I know that all the files with the starting dot are configurations. Now with the jest.config and eslint.config and prettier.config it will be really messy there. 🤷‍♂️

Note: there are actually two presets, one for the browser environment and one for the server. The server is used by default. Please, see a readme of the package.

Additional context

Issue reference

@github-actions github-actions bot added the maintenance Changes to the build process or auxilary tools and libraries or other maintenance label May 15, 2024
Copy link

netlify bot commented May 15, 2024

Deploy Preview for spirit-design-system-storybook ready!

Name Link
🔨 Latest commit 7fa9d06
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-storybook/deploys/664dbb336605a00008642cc0
😎 Deploy Preview https://deploy-preview-1411--spirit-design-system-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 15, 2024

Deploy Preview for spirit-design-system ready!

Name Link
🔨 Latest commit 7fa9d06
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system/deploys/664dbb33e942d00008a9225e
😎 Deploy Preview https://deploy-preview-1411--spirit-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (🟢 up 1 from production)
Accessibility: 93 (no change from production)
Best Practices: 100 (no change from production)
SEO: 82 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@coveralls
Copy link

coveralls commented May 15, 2024

Coverage Status

coverage: 79.544% (-17.4%) from 96.911%
when pulling 7fa9d06 on chore/jest-config-spirit
into ea1b9e8 on main.

@literat literat marked this pull request as ready for review May 16, 2024 13:44
@literat literat force-pushed the chore/jest-config-spirit branch 3 times, most recently from 73e527e to cf0453c Compare May 16, 2024 13:52
Copy link
Member

@crishpeen crishpeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

configs/jest-config-spirit/package.json Outdated Show resolved Hide resolved
configs/jest-config-spirit/README.md Outdated Show resolved Hide resolved
@literat literat merged commit 55bb122 into main May 22, 2024
24 checks passed
@literat literat deleted the chore/jest-config-spirit branch May 22, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Changes to the build process or auxilary tools and libraries or other maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants