@flakiness/vitest 1.0.0 → 1.1.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 +0 -16
- package/lib/reporter.js +5 -11
- package/package.json +1 -1
- package/types/src/reporter.d.ts +0 -2
- package/types/src/reporter.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,6 @@ A custom Vitest reporter that generates Flakiness Reports from your Vitest test
|
|
|
20
20
|
- [`token?: string`](#token-string)
|
|
21
21
|
- [`outputFolder?: string`](#outputfolder-string)
|
|
22
22
|
- [`duplicates?: 'fail' | 'rename'`](#duplicates-fail--rename)
|
|
23
|
-
- [`open?: 'always' | 'never' | 'on-failure'`](#open-always--never--on-failure)
|
|
24
23
|
- [`disableUpload?: boolean`](#disableupload-boolean)
|
|
25
24
|
- [Environment Variables](#environment-variables)
|
|
26
25
|
- [Example Configuration](#example-configuration)
|
|
@@ -220,20 +219,6 @@ reporters: [
|
|
|
220
219
|
```
|
|
221
220
|
|
|
222
221
|
|
|
223
|
-
### `open?: 'always' | 'never' | 'on-failure'`
|
|
224
|
-
|
|
225
|
-
Controls when the report viewer should automatically open in your browser after test completion.
|
|
226
|
-
|
|
227
|
-
- **`'on-failure'`** (default): Opens the report only if tests failed and running in an interactive terminal (not in CI)
|
|
228
|
-
- **`'always'`**: Always opens the report after test completion (when running in an interactive terminal)
|
|
229
|
-
- **`'never'`**: Never automatically opens the report
|
|
230
|
-
|
|
231
|
-
```typescript
|
|
232
|
-
reporters: [
|
|
233
|
-
['@flakiness/vitest', { open: 'always' }]
|
|
234
|
-
]
|
|
235
|
-
```
|
|
236
|
-
|
|
237
222
|
### `disableUpload?: boolean`
|
|
238
223
|
|
|
239
224
|
When set to `true`, prevents uploading the report to Flakiness.io. The report is still generated locally. Can also be controlled via the `FLAKINESS_DISABLE_UPLOAD` environment variable.
|
|
@@ -271,7 +256,6 @@ export default defineConfig({
|
|
|
271
256
|
token: process.env.FLAKINESS_ACCESS_TOKEN,
|
|
272
257
|
outputFolder: './flakiness-report',
|
|
273
258
|
duplicates: 'fail',
|
|
274
|
-
open: 'on-failure',
|
|
275
259
|
disableUpload: false,
|
|
276
260
|
}]
|
|
277
261
|
],
|
package/lib/reporter.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FlakinessReport as FK } from "@flakiness/flakiness-report";
|
|
2
|
-
import { CIUtils, CPUUtilization, GitWorktree, RAMUtilization, ReportUtils,
|
|
2
|
+
import { CIUtils, CPUUtilization, GitWorktree, RAMUtilization, ReportUtils, uploadReport, writeReport } from "@flakiness/sdk";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import crypto from "crypto";
|
|
5
5
|
import assert from "node:assert";
|
|
@@ -358,19 +358,13 @@ class ReporterImpl {
|
|
|
358
358
|
logger: this._logger
|
|
359
359
|
});
|
|
360
360
|
}
|
|
361
|
-
const
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
await showReport(outputFolder);
|
|
365
|
-
} else {
|
|
366
|
-
const defaultOutputFolder = path.join(process.cwd(), "flakiness-report");
|
|
367
|
-
const folder = defaultOutputFolder === outputFolder ? "" : path.relative(process.cwd(), outputFolder);
|
|
368
|
-
this._logger.log(`
|
|
361
|
+
const defaultOutputFolder = path.join(process.cwd(), "flakiness-report");
|
|
362
|
+
const folder = defaultOutputFolder === outputFolder ? "" : path.relative(process.cwd(), outputFolder);
|
|
363
|
+
this._logger.log(`
|
|
369
364
|
To open last Flakiness report, run:
|
|
370
365
|
|
|
371
366
|
${chalk.cyan(`npx flakiness show ${folder}`)}
|
|
372
|
-
|
|
373
|
-
}
|
|
367
|
+
`);
|
|
374
368
|
}
|
|
375
369
|
}
|
|
376
370
|
function dupeSuffix(dupeIndex) {
|
package/package.json
CHANGED
package/types/src/reporter.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ interface UserConsoleLog {
|
|
|
9
9
|
time: number;
|
|
10
10
|
size: number;
|
|
11
11
|
}
|
|
12
|
-
export type OpenMode = 'always' | 'never' | 'on-failure';
|
|
13
12
|
export type FKVitestReporterOptions = {
|
|
14
13
|
disableUpload?: boolean;
|
|
15
14
|
flakinessProject?: string;
|
|
@@ -17,7 +16,6 @@ export type FKVitestReporterOptions = {
|
|
|
17
16
|
token?: string;
|
|
18
17
|
outputFolder?: string;
|
|
19
18
|
duplicates?: 'fail' | 'rename';
|
|
20
|
-
open?: OpenMode;
|
|
21
19
|
};
|
|
22
20
|
export interface FKVitestLogger {
|
|
23
21
|
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;AAC9G,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,OAAO,CAAC;IAClB,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,
|
|
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;AAC9G,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,OAAO,CAAC;IAClB,I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