You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Integrate aspect_rules_jest dependency for test execution
Configure Jest test runner with Bazel build system
Update dependencies for Jest CLI and test utilities
Diagram Walkthrough
flowchart LR
A["MODULE.bazel"] -->|"Add aspect_rules_jest"| B["Bazel Dependencies"]
C["BUILD.bazel"] -->|"Load jest_test rule"| D["Jest Test Target"]
E["jest.config.cjs"] -->|"Update transformIgnorePatterns"| F["Jest Configuration"]
G["package.json"] -->|"Add jest-cli, jest-junit, jest-util"| H["Test Dependencies"]
B --> D
F --> D
H --> D
Loading
File Walkthrough
Relevant files
Dependencies
MODULE.bazel
Add aspect_rules_jest Bazel dependency
MODULE.bazel
Added aspect_rules_jest version 0.24.3 as a new Bazel dependency
Enables Jest test framework integration with Bazel build system
Add a reporters property to jest.config.cjs to configure jest-junit. This will enable the generation of JUnit XML reports, making use of the newly added dependency.
Why: The PR adds the jest-junit dependency but does not configure it. This suggestion correctly proposes to add the reporter configuration in jest.config.cjs, which makes the newly added dependency functional and useful for CI environments.
Medium
Use srcs for test files
In the jest_test rule, move test source files from the data attribute to the srcs attribute. Use glob with an exclude pattern to keep non-test source files in data.
Why: The suggestion correctly points out that test files should be in the srcs attribute for jest_test for semantic correctness and to align with Bazel best practices, which can improve dependency tracking and caching.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement, Tests
Description
Add Bazel support for grid-ui Jest tests
Integrate aspect_rules_jest dependency for test execution
Configure Jest test runner with Bazel build system
Update dependencies for Jest CLI and test utilities
Diagram Walkthrough
File Walkthrough
MODULE.bazel
Add aspect_rules_jest Bazel dependencyMODULE.bazel
aspect_rules_jestversion 0.24.3 as a new Bazel dependencypackage.json
Add Jest CLI and reporting dependenciesjavascript/grid-ui/package.json
jest-cliversion ^29.7.0 for command-line test executionjest-junitversion ^16.0.0 for JUnit XML test reportingjest-utilversion ^30.2.0 for Jest utilitiespnpm-lock.yaml
Update dependency lock filepnpm-lock.yaml
jest-util
@jest/schemas, @jest/types versions 30.x)
BUILD.bazel
Configure Jest test target in Bazeljavascript/grid-ui/BUILD.bazel
jest_testrule from@aspect_rules_jest//jest:defs.bzlTEST_DEPSlist with testing libraries (@testing-library/react,@testing-library/jest-dom, ts-jest, jest-environment-jsdom)
jest_testtarget named "test" with Jest configuration, sourcefiles, and dependencies
jest.config.cjs
Update Jest transformIgnorePatterns for Bazeljavascript/grid-ui/jest.config.cjs
transformIgnorePatternsregex to handle Aspect Rules JSnode_modules structure
'node_modules/(?!(pretty-ms|parse-ms)/)'to'node_modules/(?!(\\.aspect_rules_js/.*/)?(pretty-ms|parse-ms)/)'