Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/release-jabtrunner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release jabtrunner

on:
workflow_dispatch: {}
push:
tags:
- "jabtrunner-v*"

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Validate tag matches package version
if: startsWith(github.ref_name, 'jabtrunner-v')
run: |
TAG_VERSION="${GITHUB_REF_NAME#jabtrunner-v}"
PKG_VERSION="$(node -p "require('./packages/jabtrunner/package.json').version")"
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "Tag version ($TAG_VERSION) does not match packages/jabtrunner version ($PKG_VERSION)"
exit 1
fi

- name: Build tarball (npm pack)
run: |
cd packages/jabtrunner
TARBALL="$(npm pack --silent)"
echo "TARBALL=$TARBALL" >> "$GITHUB_ENV"

- name: Create GitHub Release and upload tarball
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: packages/jabtrunner/${{ env.TARBALL }}

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
"scripts": {
"build": "tsc -p tsconfig.server.json && tsc -p tsconfig.react.json",
"prepack": "pnpm build",
"test": "pnpm run build && test-runner all",
"test:unit": "test-runner unit",
"test:e2e": "pnpm run build && test-runner e2e",
"test:scenario": "pnpm run build && test-runner scenario",
"test:smoke": "pnpm run build && test-runner scenario --smoke",
"test": "pnpm run build && jabtrunner all",
"test:unit": "jabtrunner unit",
"test:e2e": "pnpm run build && jabtrunner e2e",
"test:scenario": "pnpm run build && jabtrunner scenario",
"test:smoke": "pnpm run build && jabtrunner scenario --smoke",
"test:integration": "node -e \"console.log('No integration tests in this repo. (intentional)')\"",
"test:docs": "pnpm run build && test-runner e2e --project docs",
"test:docs": "pnpm run build && jabtrunner e2e --project docs",
"test:client": "pnpm run test:unit",
"test:server:coverage": "rm -rf .cache/v8-coverage && pnpm run build && NODE_V8_COVERAGE=.cache/v8-coverage test-runner scenario && NODE_V8_COVERAGE=.cache/v8-coverage test-runner e2e",
"test:server:coverage": "rm -rf .cache/v8-coverage && pnpm run build && NODE_V8_COVERAGE=.cache/v8-coverage jabtrunner scenario && NODE_V8_COVERAGE=.cache/v8-coverage jabtrunner e2e",
"test:client:coverage": "rm -rf .cache/coverage/client && pnpm exec vitest run --coverage",
"coverage:server:report": "rm -rf .cache/coverage/server && pnpm exec c8 report --temp-directory .cache/v8-coverage --reporter=text-summary --reporter=json-summary --report-dir .cache/coverage/server --all --src src/server --exclude \"**/playwright.config.ts\" --exclude \"tests/**\" --exclude \"src/react/**\" && node scripts/normalize-coverage-summary.mjs .cache/coverage/server/coverage-summary.json",
"coverage:merge": "node scripts/merge-coverage-summaries.mjs .cache/coverage/server/coverage-summary.json .cache/coverage/client/coverage-summary.json coverage/coverage-summary.json",
Expand Down Expand Up @@ -67,7 +67,7 @@
"@testing-library/jest-dom": "^6.9.0",
"@testing-library/react": "^16.3.0",
"@vitest/coverage-v8": "^3.2.4",
"test-runner": "file:packages/test-runner",
"jabtrunner": "file:packages/jabtrunner",
"c8": "^10.1.3",
"jsdom": "^26.1.0",
"react": "^19.2.0",
Expand Down
22 changes: 22 additions & 0 deletions packages/jabtrunner/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2026 holiber

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

26 changes: 21 additions & 5 deletions packages/test-runner/README.md → packages/jabtrunner/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
# test-runner
# jabtrunner

Small, policy-light test runner intended to be copied between repos (or published).
Just Another Browser Test Runner.

Small, policy-light test runner intended to be copied between repos (or released as a GitHub tarball) without requiring an npm publish.

## Install (from GitHub Releases)

Add the `.tgz` asset URL from a release tag:

```bash
pnpm add -D https://github.com/holiber/jabterm/releases/download/jabtrunner-v0.1.0/jabtrunner-0.1.0.tgz
```

Or with npm:

```bash
npm i -D https://github.com/holiber/jabterm/releases/download/jabtrunner-v0.1.0/jabtrunner-0.1.0.tgz
```

## CLI

```bash
test-runner <suite> [--smoke] [--human] [--pkg <name>...] [--project <name>] [--allow-missing-project]
jabtrunner <suite> [--smoke] [--human] [--pkg <name>...] [--project <name>] [--allow-missing-project]
```

Suites:
Expand All @@ -27,7 +43,7 @@ Smoke rules (`--smoke`) apply to Playwright suites only:
Human execution (`--human`) is orthogonal:

- Playwright: `--headed`, `--workers=1`, `--trace=on`
- Exposes `TEST_RUNNER_HUMAN=1` for test utilities (see `test-runner/human`)
- Exposes `TEST_RUNNER_HUMAN=1` for test utilities (see `jabtrunner/human`)

## Artifacts

Expand Down Expand Up @@ -62,7 +78,7 @@ export default defineConfig({
## Test helper: `breath()`

```js
import { breath } from "test-runner/human";
import { breath } from "jabtrunner/human";

await breath(300);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ async function runPlaywright({
}

const argv = await yargs(hideBin(process.argv))
.scriptName("test-runner")
.scriptName("jabtrunner")
.command(
"$0 <suite>",
"Run tests",
Expand Down
23 changes: 23 additions & 0 deletions packages/jabtrunner/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "jabtrunner",
"version": "0.1.0",
"description": "Just Another Browser Test Runner (unit/e2e/scenario/smoke/human) with stable artifacts.",
"type": "module",
"license": "MIT",
"bin": {
"jabtrunner": "./bin/jabtrunner.mjs"
},
"exports": {
"./human": "./src/human.mjs"
},
"files": [
"bin",
"src",
"README.md",
"LICENSE"
],
"dependencies": {
"yargs": "^18.0.0"
}
}

File renamed without changes.
21 changes: 0 additions & 21 deletions packages/test-runner/package.json

This file was deleted.

22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/react-demo.scenario.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { test, expect } from "@playwright/test";
import { breath } from "test-runner/human";
import { breath } from "jabtrunner/human";

test.describe("React demo page", () => {
test("mount/unmount and layout resize work", async ({ page }) => {
Expand Down