liferay/liferay-portal / .claude/skills/pr-check
pr-check
VerifiedCheck that a PR is ready to be sent for review.
validations/workspaces/workspace-javascript-unit-test.md
View on GitHub# Workspace JavaScript Unit Tests
## Match
`\.(cjs|css|js|json|jsx|mjs|scss|snap|ts|tsx)$|(^|/)(\.babelrc|yarn\.lock)$`
## Command
```bash
cd "${BUILD_ROOT}"
git grep --extended-regexp --quiet '"test"[[:space:]]*:' -- ':(glob)**/package.json'
```
When the command exits nonzero, no `package.json` in the workspace declares a `test` script, so there is no JavaScript suite to run. Report **NOT APPLICABLE**, since `packageRunTest` exists only in a workspace where some `package.json` declares a `test` script, and naming a task that Gradle cannot find fails the whole command before any test runs. Otherwise run:
```bash
cd "${BUILD_ROOT}"
./gradlew --continue packageRunTest
```
`packageRunTest` runs every JavaScript unit test in the workspace, with no integration test and no product bundle. Every suite runs rather than a selection by counterpart.
The match selects the paths that can change a JavaScript unit test: a frontend source, a JSON file such as a `package.json` or one a component imports, a Jest snapshot, the `.babelrc` that `babel-jest` reads, and a lockfile, since a dependency pin can affect any code path. Any other path, such as a Java source or a `build.gradle` file, runs no JavaScript test.
`--continue` keeps one failing module from hiding the rest.
Decide PASS or FAIL from Jest's **`Test Suites:`** line, not from the exit status and not from the `Tests:` line. A suite that fails to load contributes no test case, so `Tests:` reports it as zero failures while the run exits nonzero.
Report FAIL when the diff changed a failing test or the code it exercises, quoting the test and its assertion. When the diff touches neither the failing test nor the code it exercises, the workspace is already broken, so report **NOT VERIFIED** for it and name the commit that last changed each of them. Decide this from the diff rather than by checking out the base branch, which would disturb the working tree.
## Time Estimate
~1-5 min.Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |