@aljazmc/testero 0.3.1 → 0.3.2

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/README.md +17 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,10 +1,16 @@
1
- ![Custom](https://img.shields.io/badge/project_status-barely_working-yellow) ![Custom](https://img.shields.io/badge/breaking_changes-common-red) ![NPM Downloads](https://img.shields.io/npm/dm/%40aljazmc%2Ftestero) ![GitHub package.json version](https://img.shields.io/github/package-json/v/aljazmc/aljazmc?filename=packages%2Ftestero%2Fpackage.json&color=green) ![GitHub License](https://img.shields.io/github/license/aljazmc/aljazmc)
1
+ ![Custom](https://img.shields.io/badge/project_status-mostly_working-green) ![Custom](https://img.shields.io/badge/breaking_changes-common-red) ![NPM Downloads](https://img.shields.io/npm/dm/%40aljazmc%2Ftestero) ![GitHub package.json version](https://img.shields.io/github/package-json/v/aljazmc/aljazmc?filename=packages%2Ftestero%2Fpackage.json&color=green) ![GitHub License](https://img.shields.io/github/license/aljazmc/aljazmc)
2
2
 
3
3
  # > testero
4
4
 
5
5
  A simple, Jest-like test runner. Easy to understand, easy to customize and easy to extend.
6
6
 
7
- ## > usage
7
+ ## > Install
8
+
9
+ ```sh
10
+ npm install --save-dev @aljazmc/testero
11
+ ```
12
+
13
+ ## > Usage
8
14
 
9
15
  ```sh
10
16
  testero # run every test file
@@ -16,7 +22,9 @@ testero --config # write the defaults to testero.config.ts, --config j
16
22
  testero --help
17
23
  ```
18
24
 
19
- Test files are written like for [Jest](https://jestjs.io), in JavaScript, TypeScript or JSX, with the same globals:
25
+ ## > Writing tests
26
+
27
+ testero runs test files written in JavaScript, TypeScript or JSX, with the same globals as [Jest](https://jestjs.io):
20
28
 
21
29
  ```ts
22
30
  import { add } from "../src/math.ts";
@@ -49,9 +57,11 @@ describe("add", () => {
49
57
  - asymmetric matchers: `expect.any`, `expect.anything`, `expect.objectContaining`, `expect.arrayContaining`, `expect.stringContaining`, `expect.stringMatching`, `expect.closeTo` and their `expect.not` variants
50
58
  - `testero.fn`, `testero.spyOn`, `testero.clearAllMocks`, `testero.resetAllMocks`, `testero.restoreAllMocks` and `testero.setTimeout`, also as `jest`; imports from `@jest/globals` get the same functions
51
59
 
52
- Failures show the message, a diff of expected and received values, and the code where they happened.
60
+ testero reports each failure with its message, a diff of the expected and received values, and the code where it happened.
61
+
62
+ ## > Configuration
53
63
 
54
- Settings follow Jest's names and defaults. Override them with `testero.config.ts` or `testero.config.js` in the current directory; objects are merged deeply, anything else (like `ignore`) replaces the default:
64
+ testero reads `testero.config.ts` or `testero.config.js` from the current directory, with Jest's names and defaults. Objects are merged deeply into the defaults, anything else (like `ignore`) replaces them:
55
65
 
56
66
  ```js
57
67
  export default {
@@ -73,7 +83,7 @@ export default {
73
83
  };
74
84
  ```
75
85
 
76
- ## > how it works
86
+ ## > How it works
77
87
 
78
88
  - `src/transformer.ts`: bundles each test file and the local files it imports with [esbuild](https://esbuild.github.io), the only dependency, into one module; installed packages stay external and the globals are injected where the file uses them
79
89
  - `src/collector.ts`: the `describe`, `test` and hook functions, collecting what a test file declares into a tree of suites (`src/suite.ts`)
@@ -84,4 +94,4 @@ export default {
84
94
  - `src/testero.ts`: finds the test files and runs them one after another
85
95
  - `@aljazmc/config` (`shared/config`): loads `testero.config.ts`, finds the files and matches `testMatch`, shared with every package
86
96
 
87
- Each test file is bundled on its own, so it gets fresh copies of the files it imports, and spies are restored after it. Test files run one after another in one process, without workers, module mocking, fake timers, snapshots or coverage.
97
+ testero bundles each test file on its own, so it gets fresh copies of the files it imports, and spies are restored after it. Test files run one after another in one process, without workers, module mocking, fake timers, snapshots or coverage.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aljazmc/testero",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "A simple, Jest like test runner. Easy to understand, easy to customize and easy to extend.",
5
5
  "author": "aljazmc",
6
6
  "license": "MIT",