Skip to content

Update jest scripts#5882

Merged
witoszekdev merged 6 commits intomainfrom
update-jest-command
Sep 26, 2025
Merged

Update jest scripts#5882
witoszekdev merged 6 commits intomainfrom
update-jest-command

Conversation

@witoszekdev
Copy link
Member

@witoszekdev witoszekdev commented Sep 18, 2025

This PR updates Jest scripts to work better when running in AI tools: it now provides a default tests directory, that can be easily overwritten when running the command via npm

E.g.

npm run test -- tests/my-test-to-run.ts

Previously such command would run all tests anyway.

It also add new options to run jest:

  • npm run test:watch to run in watch mode
  • npm run test:silent to disable console.log, console.error and console.warn outputs during tests
  • npm run test:debug to extend react-testing-library output log to help with investigating incorrect assertions

Also modified npm run test:ci in order to also supress console.log in the test results, to make the output easier to read (currently it can freeze browser due to very long output)

@witoszekdev witoszekdev requested a review from a team as a code owner September 18, 2025 14:36
@changeset-bot
Copy link

changeset-bot bot commented Sep 18, 2025

⚠️ No Changeset found

Latest commit: cb5a27f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Sep 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
saleor-dashboard-storybook Ignored Ignored Preview Sep 26, 2025 0:47am

@witoszekdev witoszekdev added the skip changeset Use if your changes doesn't need entry in changelog label Sep 18, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates Jest testing scripts to improve usability when running tests, particularly for AI tools. The changes replace the previous hardcoded src/ directory path with a flexible default configuration that allows overriding specific test paths via command arguments.

  • Replaces hardcoded src/ directory with flexible Jest configuration
  • Adds new test script variants for different use cases (watch, debug, quiet, silent)
  • Updates documentation to guide proper usage of the new test commands

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
package.json Updates Jest scripts to remove hardcoded paths and adds new test variants with different output configurations
AGENTS.md Documents the new test scripts and provides usage guidelines for AI tools

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.00%. Comparing base (e08d154) to head (cb5a27f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #5882     +/-   ##
=========================================
  Coverage   39.00%   39.00%             
=========================================
  Files        2754     2754             
  Lines       43488    43488             
  Branches     9828     9474    -354     
=========================================
  Hits        16964    16964             
- Misses      25208    26494   +1286     
+ Partials     1316       30   -1286     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 18, 2025

Differences Found

✅ No packages or licenses were added.

Summary

Expand
License Name Package Count Packages
0BSD 1
Packages
  • tslib
CC-BY-3.0 1
Packages
  • spdx-exceptions
MIT/X11 1
Packages
  • nub
MPL-1.1 1
Packages
  • harmony-reflect
MPL-2.0 1
Packages
  • dompurify
Public Domain 1
Packages
  • jsonify
Python-2.0 1
Packages
  • argparse
WTFPL 1
Packages
  • utf8-byte-length
<<missing>> 2
Packages
  • busboy
  • streamsearch
CC-BY-4.0 2
Packages
  • @saleor/macaw-ui
  • caniuse-lite
CC0-1.0 2
Packages
  • spdx-license-ids
  • type-fest
SEE LICENSE IN LICENSE 2
Packages
  • posthog-js
  • spawndamnit
BlueOak-1.0.0 3
Packages
  • jackspeak
  • package-json-from-dist
  • path-scurry
BSD-2-Clause 24
Packages
  • browser-process-hrtime
  • css-select
  • css-what
  • domelementtype
  • domhandler
  • domutils
  • dotenv
  • dotenv-expand
  • entities
  • escodegen
  • eslint-scope
  • espree
  • esprima
  • esrecurse
  • estraverse
  • esutils
  • normalize-package-data
  • nth-check
  • regjsparser
  • stringify-object
  • And 4 more...
BSD-3-Clause 42
Packages
  • @saleor/app-sdk
  • @sentry/cli
  • @sentry/cli-darwin
  • @sentry/cli-linux-arm
  • @sentry/cli-linux-arm64
  • @sentry/cli-linux-i686
  • @sentry/cli-linux-x64
  • @sentry/cli-win32-arm64
  • @sentry/cli-win32-i686
  • @sentry/cli-win32-x64
  • @sinonjs/commons
  • @sinonjs/fake-timers
  • abab
  • asn1js
  • babel-plugin-istanbul
  • chroma-js
  • diff
  • esquery
  • exenv
  • hoist-non-react-statics
  • And 22 more...
ISC 50
Packages
  • @isaacs/cliui
  • @istanbuljs/load-nyc-config
  • anymatch
  • boolbase
  • cli-width
  • cliui
  • electron-to-chromium
  • fastq
  • flatted
  • foreground-child
  • fs.realpath
  • get-caller-file
  • get-own-enumerable-property-symbols
  • glob
  • glob-parent
  • graceful-fs
  • hosted-git-info
  • inflight
  • inherits
  • ini
  • And 30 more...
Apache-2.0 57
Packages
  • @ampproject/remapping
  • @editorjs/editorjs
  • @eslint/config-array
  • @eslint/config-helpers
  • @eslint/core
  • @eslint/object-schema
  • @eslint/plugin-kit
  • @humanfs/core
  • @humanfs/node
  • @humanwhocodes/module-importer
  • @humanwhocodes/retry
  • @opentelemetry/api
  • @opentelemetry/semantic-conventions
  • @playwright/test
  • @pollyjs/adapter
  • @pollyjs/core
  • @pollyjs/persister
  • @pollyjs/utils
  • @swc/core
  • @swc/core-darwin-arm64
  • And 37 more...
MIT 1258
Packages
  • @adobe/css-tools
  • @apollo/client
  • @ardatan/relay-compiler
  • @ardatan/sync-fetch
  • @babel/code-frame
  • @babel/compat-data
  • @babel/core
  • @babel/generator
  • @babel/helper-annotate-as-pure
  • @babel/helper-compilation-targets
  • @babel/helper-create-class-features-plugin
  • @babel/helper-globals
  • @babel/helper-member-expression-to-functions
  • @babel/helper-module-imports
  • @babel/helper-module-transforms
  • @babel/helper-optimise-call-expression
  • @babel/helper-plugin-utils
  • @babel/helper-replace-supers
  • @babel/helper-skip-transparent-expression-wrappers
  • @babel/helper-string-parser
  • And 1238 more...

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 18, 2025 15:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot temporarily deployed to pr-5882 September 18, 2025 15:45 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5882 September 19, 2025 13:45 Destroyed
Copilot AI review requested due to automatic review settings September 22, 2025 06:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot temporarily deployed to pr-5882 September 22, 2025 06:41 Destroyed
@witoszekdev
Copy link
Member Author

I've fixed the description, to use test:quiet in order to limit output from test runs in AGENTS.md

Copilot AI review requested due to automatic review settings September 26, 2025 12:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@witoszekdev witoszekdev requested a review from Copilot September 26, 2025 12:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@witoszekdev witoszekdev enabled auto-merge (squash) September 26, 2025 14:17
@witoszekdev witoszekdev merged commit 8c38716 into main Sep 26, 2025
25 checks passed
@witoszekdev witoszekdev deleted the update-jest-command branch September 26, 2025 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset Use if your changes doesn't need entry in changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants