kempo-testing-framework 1.4.4 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/llm.txt +61 -0
  2. package/package.json +1 -1
package/llm.txt ADDED
@@ -0,0 +1,61 @@
1
+ # Kempo Testing Framework
2
+
3
+ ## Install
4
+ `npm install kempo-testing-framework --save-dev`
5
+
6
+ ## Test File Naming
7
+ - `name.browser-test.js` — browser only
8
+ - `name.node-test.js` — Node only
9
+ - `name.test.js` — both environments
10
+
11
+ Place files anywhere under `tests/` (recursive discovery).
12
+
13
+ ## Test File Structure
14
+ ```js
15
+ import yourModule from '../src/yourModule.js';
16
+
17
+ // Optional lifecycle exports (all async-capable, receive `log` function)
18
+ export const beforeAll = async (log) => {};
19
+ export const beforeEach = async (log) => {};
20
+ export const afterEach = async (log) => {};
21
+ export const afterAll = async (log) => {};
22
+
23
+ // Optional: custom HTML page for browser tests (path relative to test file)
24
+ export const page = './custom-page.html';
25
+
26
+ // Required: default export is an object of named tests
27
+ export default {
28
+ 'test name': ({ pass, fail, log }) => {
29
+ // log(msg) — emit a log message
30
+ // pass(msg) — mark test passed
31
+ // fail(msg) — mark test failed
32
+ pass('ok');
33
+ },
34
+ 'async test': async ({ pass, fail, log }) => {
35
+ const result = await yourModule.fn();
36
+ result === 'expected' ? pass('ok') : fail(`got ${result}`);
37
+ }
38
+ };
39
+ ```
40
+
41
+ ## CLI
42
+ ```
43
+ npx kempo-test # run all tests
44
+ npx kempo-test -b # browser only
45
+ npx kempo-test -n # node only
46
+ npx kempo-test --gui # start web GUI
47
+ npx kempo-test auth # filter files by substring
48
+ npx kempo-test auth login # filter files then tests by substring
49
+ npx kempo-test -b auth login # combined
50
+ ```
51
+
52
+ ## Key Flags
53
+ | Flag | Default | Description |
54
+ |------|---------|-------------|
55
+ | `-b` / `--browser` | — | Browser tests only |
56
+ | `-n` / `--node` | — | Node tests only |
57
+ | `-l` / `--log-level` | normal | silent\|minimal\|normal\|verbose\|debug (or 0–4) |
58
+ | `-p` / `--port` | 3000 | Browser test server port |
59
+ | `-w` / `--show-browser` | headless | Show browser window |
60
+ | `-d` / `--delay` | 0 | ms pause before/after browser tests (requires -w) |
61
+ | `-t` / `--timeout` | 30000 | Per-test timeout in ms (min 1000) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kempo-testing-framework",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "The Kempo Testing Framework is a simple testing framework built on the principle that code intended to be ran in the browser should be tested in the browser, code intended to be ran in Node should be tested in Node, and code intended to be ran in both should be tested in both. No mocking, no complexity—just testing.",
5
5
  "main": "index.js",
6
6
  "bin": {