Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix(core): Test reports no longer contain a duplicate entry for with …
…the contents of the report
- Loading branch information
Showing
with
19 additions
and 6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,4 +1,4 @@ | ||
import { ensure, isDefined, isString, JSONObject, Predicate, TinyType } from 'tiny-types'; | ||
|
||
import { LogicError } from '../errors'; | ||
import * as artifacts from './artifacts'; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,8 +1,13 @@ | ||
import { JSONObject } from 'tiny-types'; | ||
import { Artifact } from '../Artifact'; | ||
|
||
export class TestReport extends Artifact { | ||
|
||
static fromJSON(value: JSONObject) { | ||
return new TestReport(Buffer.from(JSON.stringify(value, null, 0), 'utf8').toString('base64')); | ||
} | ||
|
||
map<O>(fn: (decodedValue: JSONObject) => O): O { | ||
return fn(JSON.parse(Buffer.from(this.base64EncodedValue, 'base64').toString('utf8'))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,7 @@ | ||
import { JSONData } from './JSONData'; | ||
|
||
export class TextData extends JSONData { | ||
static fromJSON(value: { contentType: string, data: string }) { | ||
return new TextData(Buffer.from(JSON.stringify(value, null, 0), 'utf8').toString('base64')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -2,3 +2,4 @@ export * from './HTTPRequestResponse'; | ||
export * from './JSONData'; | ||
export * from './Photo'; | ||
export * from './TestReport'; | ||
export * from './TextData'; |