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
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ const merged = merge([report1, report2, report3], {
});
```

Reports sharing a specification version retain that version when merged.
Mixed-version inputs continue to use the current specification version without
conversion or validation; validate the result against the intended contract.
Global errors are retained in input order, separately from test counts.

### ID Generation

```typescript
Expand Down Expand Up @@ -273,8 +278,8 @@ import {
} from "ctrf";

REPORT_FORMAT; // 'CTRF'
CURRENT_SPEC_VERSION; // '0.2.0'
SUPPORTED_SPEC_VERSIONS; // ['0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.1.0', '0.2.0']
CURRENT_SPEC_VERSION; // '0.3.0'
SUPPORTED_SPEC_VERSIONS; // ['0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.1.0', '0.2.0', '0.3.0']
TEST_STATUSES; // ['passed', 'failed', 'skipped', 'pending', 'other']
CTRF_NAMESPACE; // UUID namespace for deterministic IDs
```
Expand Down Expand Up @@ -319,6 +324,6 @@ const v0_0_2Schema = getSchema("0.0.2");
const latestSchema = getSchema("latest");

// Get version info
const version = getCurrentSpecVersion(); // '0.2.0'
const supported = getSupportedSpecVersions(); // ['0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.1.0', '0.2.0']
const version = getCurrentSpecVersion(); // '0.3.0'
const supported = getSupportedSpecVersions(); // ['0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.1.0', '0.2.0', '0.3.0']
```
72 changes: 56 additions & 16 deletions docs/classes/ReportBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Class: ReportBuilder

Defined in: [builder.ts:50](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L50)
Defined in: [builder.ts:53](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L53)

## Example

Expand All @@ -31,7 +31,7 @@ const report = new ReportBuilder()

> **new ReportBuilder**(`options?`): `ReportBuilder`

Defined in: [builder.ts:64](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L64)
Defined in: [builder.ts:69](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L69)

#### Parameters

Expand All @@ -49,7 +49,7 @@ Defined in: [builder.ts:64](https://github.com/ctrf-io/ctrf-js/blob/main/src/bui

> **specVersion**(`version`): `this`

Defined in: [builder.ts:76](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L76)
Defined in: [builder.ts:81](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L81)

Set the spec version.

Expand All @@ -69,7 +69,7 @@ Set the spec version.

> **reportId**(`uuid?`): `this`

Defined in: [builder.ts:85](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L85)
Defined in: [builder.ts:90](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L90)

Set or generate the report ID.

Expand All @@ -91,7 +91,7 @@ UUID to use, or undefined to auto-generate

> **runId**(`id`): `this`

Defined in: [builder.ts:93](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L93)
Defined in: [builder.ts:98](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L98)

Set the logical test run ID shared across related CTRF documents.

Expand All @@ -111,7 +111,7 @@ Set the logical test run ID shared across related CTRF documents.

> **timestamp**(`date?`): `this`

Defined in: [builder.ts:102](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L102)
Defined in: [builder.ts:107](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L107)

Set the timestamp.

Expand All @@ -133,7 +133,7 @@ Date to use, or undefined for current time

> **generatedBy**(`name`): `this`

Defined in: [builder.ts:116](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L116)
Defined in: [builder.ts:121](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L121)

Set the generator name.

Expand All @@ -153,7 +153,7 @@ Set the generator name.

> **tool**(`tool`): `this`

Defined in: [builder.ts:124](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L124)
Defined in: [builder.ts:129](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L129)

Set the tool information.

Expand All @@ -173,7 +173,7 @@ Set the tool information.

> **environment**(`env`): `this`

Defined in: [builder.ts:132](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L132)
Defined in: [builder.ts:137](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L137)

Set the environment information.

Expand All @@ -193,7 +193,7 @@ Set the environment information.

> **addTest**(`test`): `this`

Defined in: [builder.ts:140](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L140)
Defined in: [builder.ts:145](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L145)

Add a single test.

Expand All @@ -213,7 +213,7 @@ Add a single test.

> **addTests**(`tests`): `this`

Defined in: [builder.ts:148](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L148)
Defined in: [builder.ts:153](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L153)

Add multiple tests.

Expand All @@ -229,11 +229,31 @@ Add multiple tests.

***

### addError()

> **addError**(`error`): `this`

Defined in: [builder.ts:161](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L161)

Add a global error without changing test counts.

#### Parameters

##### error

[`GlobalError`](../interfaces/GlobalError.md)

#### Returns

`this`

***

### insights()

> **insights**(`insights`): `this`

Defined in: [builder.ts:156](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L156)
Defined in: [builder.ts:169](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L169)

Set run-level insights.

Expand All @@ -253,7 +273,7 @@ Set run-level insights.

> **baseline**(`baseline`): `this`

Defined in: [builder.ts:164](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L164)
Defined in: [builder.ts:177](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L177)

Set the baseline reference.

Expand All @@ -269,11 +289,31 @@ Set the baseline reference.

***

### provenance()

> **provenance**(`provenance`): `this`

Defined in: [builder.ts:183](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L183)

Set direct report provenance.

#### Parameters

##### provenance

[`Provenance`](../interfaces/Provenance.md)

#### Returns

`this`

***

### extra()

> **extra**(`data`): `this`

Defined in: [builder.ts:172](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L172)
Defined in: [builder.ts:191](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L191)

Set extra metadata.

Expand All @@ -293,7 +333,7 @@ Set extra metadata.

> **summaryOverrides**(`overrides`): `this`

Defined in: [builder.ts:181](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L181)
Defined in: [builder.ts:200](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L200)

Override specific summary fields.
Useful when you want to set specific timing or counts.
Expand All @@ -314,7 +354,7 @@ Useful when you want to set specific timing or counts.

> **build**(): [`CTRFReport`](../interfaces/CTRFReport.md)

Defined in: [builder.ts:190](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L190)
Defined in: [builder.ts:209](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L209)

Build and return the CTRF report.

Expand Down
Loading