Static analysis for test code and CI workflows.
Tests tell you what passed. Mjölnir tells you what you can trust.
Scan your test code and CI workflows for hidden failures. Get prioritized findings with the exact location, evidence, and a suggested fix.
npx mjolnir-qa@6.1.0Run from your repository root · Node.js 22.18+
You get a scan report. Mjölnir does not run your tests or automatically apply the suggested fixes.
See an example reportWhat a finding looks likeThis example flags test failures hidden by CI commands. The report shows where to look first.
$ npx mjolnir-qa@latest WORTHINESS 80/100 WORTHY ░░░░░░ Held in worthy hands — 18 findings remain. (32 raw pts / 7 test declarations — normalized) (capped: deduction mass 32 pts — absolute ceiling 95) DETECTED [playwright] ▍ FIX THIS FIRST Why it matters: 3 error findings can let a false-green or release-blocking test issue survive review. Next action: fix the highest score-gain item below, then re-run the changed scope. $ mjolnir --scope changed +8 pts QA-CI-009 · .github/workflows/ci.yml:10 +8 pts QA-CI-009 · .github/workflows/ci.yml:10 +8 pts QA-CI-009 · .github/workflows/ci.yml:26 ▍ DIAGNOSTICS BY CATEGORY QA-CI ░░░░ 76 QA-PW ░ 95 QA-TEST 97 ▍ WHERE POINTS WERE LOST ╭─────────────────────────────────────────╮ │ 3 × error − 24 │ │ 3 × warning − 7 (evidence-discounted) │ │ 12 × info − 1 (evidence-discounted) │ ╰─────────────────────────────────────────╯
Original output from a saved demo scan, replayed. Read the full report.
Follow a false green.
Find where trust breaks.
See the failure, the misleading result, and the repair in one view. Select any node for the practical next step.
01 / What the workflow does
02 / What you do next
Example: the test command exits 1. Mjölnir reads the workflow; it does not run or automatically repair your tests.
The tests fail. CI still passes.
A workflow can hide a failure after the test runner has reported it. Follow one command from the failing test to the misleading green step.
Illustrative shell outcome: npm test exits 1; the fallback true exits 0. The step returns the final success.
Read the rule and its evidencenpm test || true1 / 5 · Autoplay pauses while you read or focus this guide
One change. Two saved scans.
A minimal workflow scanned with Mjölnir 5.0.0. The ignored-exit finding disappears after removing the fallback.
These are static scan results. Run the affected tests separately: this comparison does not establish that the tests pass.
Works with your stack
Languages
- TypeScript
- JavaScript
- Python
- Java
- C#
Test frameworks
- Playwright
- Cypress
- Selenium
- Jest
- Vitest
- Mocha
- pytest
- JUnit
- TestNG
- NUnit
- xUnit
- MSTest
CI
- GitHub Actions
- Azure Pipelines
- Jenkins
- GitLab CI
What a scan covers
01CI integrity
Read the workflow. Locate the finding.
Follow the scan through a real workflow. Each highlighted line connects the command to its finding, rule, and evidence.
- ERRORQA-CI-009 Job `test` pipes the test command into another tool without `set -o pipefail`.
- ERRORQA-CI-009 Job `deploy-smoke` sequences commands with `; ` after the test command — the test result does not fail the step.
- INFOQA-CI-010 Job `deploy-smoke` runs tests but its `if:` condition skips it on pull requests.
- ERRORQA-CI-009 Job `deploy-smoke` pipes the test command into another tool without `set -o pipefail`.
- INFOQA-CI-001 Job `security-scan` runs a verification gate under `continue-on-error: true`.
QA-CI-009 Job `test` pipes the test command into another tool without `set -o pipefail`. E2 · deterministic · measured FP 0% · n=10
QA-CI-009 Job `deploy-smoke` sequences commands with `; ` after the test command — the test result does not fail the step. E2 · deterministic · measured FP 0% · n=10
QA-CI-010 Job `deploy-smoke` runs tests but its `if:` condition skips it on pull requests. E0 · observation · measured FP 10% · n=10
QA-CI-009 Job `deploy-smoke` pipes the test command into another tool without `set -o pipefail`. E2 · deterministic · measured FP 0% · n=10
QA-CI-001 Job `security-scan` runs a verification gate under `continue-on-error: true`. E0 · observation · measured FP 11% · n=19
Explore four more patterns that can hide failures
continue-on-error: trueThe job fails and the workflow still reports success.
QA-CI-001 continue-on-error masks a failing verification gatenpm test || trueThe test command's exit code is thrown away.
QA-CI-002 Ignored exit code (|| true)npm test | tee results.logOnly the exit code of tee reaches CI.
QA-CI-009 Test command does not propagate exit codetest.only("checkout", ...)The focused test runs and the rest are skipped.
QA-TEST-001 Focused test committed
Above: every finding the demo repo scan reported for .github/workflows/ci.yml, at the line it reported. With SARIF upload or mjolnir --format github-summary, this is how the findings appear on the pull request.
02Findings
Every finding says where, how sure, and how to fix it.
This is the first finding from the demo repo scan, exactly as the terminal prints it. Each part of it answers one question.
See what it checks✗ ERROR QA-CI-009 · .github/workflows/ci.yml:10 [E2 · deterministic · measured FP 0% · n=10] Finding Job `test` pipes the test command into another tool without `set -o pipefail`. Fix Add `shell: bash` with `set -o pipefail`, or split into two steps so the test command's exit code is preserved.
03Worthiness score
Understand what your score means.
See which findings need attention. The score describes your test suite; it does not certify your product.
Read how the score works| Score | Verdict & next step |
|---|---|
| 0–49 | UNWORTHY Score guide Start with the highest-impact findings. |
| 50–79 | NEEDS WORK Review the findings and address the largest deductions. |
| 80–99 | WORTHY A strong score. Findings still need review. |
| 100 | FORGED Exactly 100. A clean scan does not prove the tests pass. |
04Evidence and trust
Knows the difference between reading code and seeing it run.
Most findings come from reading your code. Give Mjölnir the report of a real test run and it can confirm the code actually ran.
Read the definitions✗ ERROR QA-CI-009 · .github/workflows/ci.yml:10 [E2 · deterministic · measured FP 0% · n=10] Finding Job `test` pipes the test command into another tool without `set -o pipefail`. Fix Add `shell: bash` with `set -o pipefail`, or split into two steps so the test command's exit code is preserved.
Mjölnir read the workflow file. Nothing ran, so this finding stays at L2, proven in code.
ℹ INFO QA-PW-146 · e2e/checkout.spec.ts:5 [E0 · observation · measured FP 12% · n=17 · trust L3 · runtime: file executed] Finding CSS/XPath string selector where a normalized locator is expected. Fix Normalize to Playwright's user-facing getters: getByRole('button', { name: '…' }), getByLabel('…'), getByTestId('…'), or getByText('…') — they survive markup refactors and match what a user actually perceives.
The Playwright report shows this spec file ran, so the finding reaches L3.
Read from code
Static evidence · L0–L2
- L0
Noted
Worth knowing. Not a claim that anything is wrong.
- L1
Looks like it
A pattern that usually means the problem was matched.
- L2
Proven in code
The code as written has the problem.
Observed in a run
Runtime evidence · L3–L5
- L3
The file ran
A real run executed the file the finding is in.
- L4
The test ran
A real run executed the test the finding is in.
- L5
The run agrees
The run's own result confirms the problem.
L3 is the boundary: a real run is required from here.
05Runtime forensics
Reads what actually ran.
Point it at a folder of test results. Playwright JSON, Jest and Vitest JSON, and JUnit XML from any runner all work.
Read the forensics guide▍ FLAKINESS LEADERBOARD3 tests · 1 failed · 1 flaky · 1 retriedTRUE-FLAKE completes checkout with saved card (e2e/checkout.spec.ts) ████████████████████ 6.0s · 2 attemptsFAILING declines an expired card (e2e/checkout.spec.ts) ████░░░░░░░░░░░░░░░░ 1.1s · 1 attempt
TRUE-FLAKE means the test failed at least once and then passed. Mjölnir flags it even though the final check was green.
06Measured rules
A published false-positive rate for each rule.
Each rate comes from at least 10 hand-classified findings in open-source repos. Rules with bad rates stay listed, in quarantine.
See all 79 rules73of79
rules measured on real code
| Rule | Catches | False positives | Sample |
|---|---|---|---|
| Extended | |||
| QA-PW-002 | Unawaited Playwright assertion | 0% | n=20 |
| QA-PY-001 | Focused test committed | 0% | n=12 |
| QA-CS-103 | Test without assertions | 0% | n=11 |
| QA-JV-103 | Test without assertions | 26% | n=58 |
| Quarantine | |||
| QA-TEST-001 | Focused test committed | 60% | n=20 |
07CI and AI agents
Gates the pull request, and checks the agent.
Scan only what a branch touched, or hand the findings to an AI agent and let the re-scan prove the fix.
Connect an agentIn CI
With --scope changed it scans the files the branch touched and exits non-zero on new findings.
npx mjolnir-qa@6.1.0 --scope changedOr add the GitHub Action:
- uses: Sergey-Bar/Mjolnir@v6
with:
version: 6.1.0
scope: changed
fail-on: errorWith an AI agent
The agent writes the fix and Mjölnir re-scans to prove it. Each finding in the handoff says whether it is safe to apply or needs a person to confirm.
claude mcp add mjolnir -- npx -y mjolnir-qa@6.1.0 mcp- 0
- Clean at the gate
- 1
- Findings at or above the gate
- 2
- Partial scan. Inconclusive; investigate and rerun.
- 10
- Usage error
- 20
- Internal error
Exit codes are frozen, so you can build CI logic on them.
Where the score stops
- It does not run your tests. A clean scan is not a passing suite.
- It cannot tell when an assertion checks the wrong value.
expect(total).toBe(41)looks healthy to it. - A perfect score means zero findings. Whether the suite covers your real risk is a separate question.
- An empty repo scores null. With no tests to read, it has nothing to score.