@flakiness/vitest 1.3.0 → 1.4.0

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.
package/README.md CHANGED
@@ -17,6 +17,7 @@ A custom Vitest reporter that generates Flakiness Reports from your Vitest test
17
17
  - [Environment Detection](#environment-detection)
18
18
  - [CI Integration](#ci-integration)
19
19
  - [Configuration Options](#configuration-options)
20
+ - [`title?: string`](#title-string)
20
21
  - [`flakinessProject?: string`](#flakinessproject-string)
21
22
  - [`endpoint?: string`](#endpoint-string)
22
23
  - [`token?: string`](#token-string)
@@ -160,6 +161,16 @@ The reporter automatically detects CI environments and includes:
160
161
 
161
162
  The reporter accepts the following options:
162
163
 
164
+ ### `title?: string`
165
+
166
+ Optional human-readable report title. Typically used to name a CI run, matrix shard, or other execution group. Defaults to the `FLAKINESS_TITLE` environment variable, or auto-detects from the CI environment.
167
+
168
+ ```typescript
169
+ reporters: [
170
+ ['@flakiness/vitest', { title: 'Shard 1/4 — Linux Chrome' }]
171
+ ]
172
+ ```
173
+
163
174
  ### `flakinessProject?: string`
164
175
 
165
176
  The Flakiness.io project identifier in `org/project` format. Used for GitHub OIDC authentication — when set, and the Flakiness.io project is bound to the GitHub repository running the workflow, the reporter authenticates uploads via GitHub Actions OIDC token with no access token required.
@@ -235,6 +246,7 @@ reporters: [
235
246
 
236
247
  The reporter respects the following environment variables:
237
248
 
249
+ - **`FLAKINESS_TITLE`**: Human-readable report title (equivalent to `title` option)
238
250
  - **`FLAKINESS_ACCESS_TOKEN`**: Access token for Flakiness.io uploads (equivalent to `token` option)
239
251
  - **`FLAKINESS_ENDPOINT`**: Custom Flakiness.io endpoint URL (equivalent to `endpoint` option)
240
252
  - **`FLAKINESS_OUTPUT_DIR`**: Output directory for reports (equivalent to `outputFolder` option)
@@ -253,6 +265,7 @@ export default defineConfig({
253
265
  reporters: [
254
266
  'default',
255
267
  ['@flakiness/vitest', {
268
+ title: 'My Test Run',
256
269
  flakinessProject: 'my-org/my-project',
257
270
  endpoint: process.env.FLAKINESS_ENDPOINT,
258
271
  token: process.env.FLAKINESS_ACCESS_TOKEN,
package/lib/reporter.js CHANGED
@@ -321,7 +321,9 @@ class ReporterImpl {
321
321
  }
322
322
  }
323
323
  const duration = Date.now() - this._startTimestamp;
324
+ const title = this._options.title ?? process.env.FLAKINESS_TITLE ?? CIUtils.runTitle();
324
325
  const report = ReportUtils.normalizeReport({
326
+ title,
325
327
  url: CIUtils.runUrl(),
326
328
  flakinessProject: this._options.flakinessProject,
327
329
  category: "vitest",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flakiness/vitest",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "",
5
5
  "main": "lib/reporter.js",
6
6
  "keywords": [],
@@ -22,8 +22,8 @@
22
22
  "vitest": "^4.0.18"
23
23
  },
24
24
  "dependencies": {
25
- "@flakiness/flakiness-report": "^0.28.0",
26
- "@flakiness/sdk": "^2.4.0"
25
+ "@flakiness/flakiness-report": "^0.29.0",
26
+ "@flakiness/sdk": "^2.5.0"
27
27
  },
28
28
  "scripts": {
29
29
  "build": "kubik build.mts",
@@ -16,6 +16,7 @@ export type FKVitestReporterOptions = {
16
16
  token?: string;
17
17
  outputFolder?: string;
18
18
  duplicates?: 'fail' | 'rename';
19
+ title?: string;
19
20
  };
20
21
  export interface FKVitestLogger {
21
22
  log(txt: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../src/reporter.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAY,UAAU,EAAe,gBAAgB,EAAa,MAAM,EAAE,MAAM,aAAa,CAAC;AAC3H,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIjD,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,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