@serenity-js/core
Version:
The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure
15 lines (10 loc) • 457 B
text/typescript
import type { JSONObject } from 'tiny-types';
import { Artifact } from '../Artifact';
export class TestReport extends Artifact {
static fromJSON(value: JSONObject): TestReport {
return new TestReport(Buffer.from(JSON.stringify(value, undefined, 0), 'utf8').toString('base64'));
}
map<O>(fn: (decodedValue: JSONObject) => O): O {
return fn(JSON.parse(Buffer.from(this.base64EncodedValue, 'base64').toString('utf8')));
}
}