-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #564 from golemfactory/feature/JST-291/fix-issues-…
…exposed-by-examples-for-presentation JST-291: Fix issues exposed by examples for presentation
- Loading branch information
Showing
30 changed files
with
543 additions
and
141 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,8 @@ | |
"fibonacci": "node ./fibonacci/fibonacci.js", | ||
"ssh": "ts-node ./ssh/ssh.ts", | ||
"tag": "ts-node ./simple-usage/tag.ts", | ||
"web": "node ./web/app.mjs" | ||
"web": "node ./web/app.mjs", | ||
"lint:ts": "tsc --project tsconfig.json --noEmit" | ||
}, | ||
"author": "GolemFactory <[email protected]>", | ||
"license": "LGPL-3.0", | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Result, ResultState } from "./results"; | ||
|
||
describe("Results", () => { | ||
describe("converting output to JSON", () => { | ||
describe("positive cases", () => { | ||
test("produces JSON when the stdout contains correct data", () => { | ||
const result = new Result({ | ||
index: 0, | ||
result: ResultState.Ok, | ||
stdout: '{ "value": 55 }\n', | ||
stderr: null, | ||
message: null, | ||
isBatchFinished: true, | ||
eventDate: "2023-08-29T09:23:52.305095307Z", | ||
}); | ||
|
||
expect(result.getOutputAsJson()).toEqual({ | ||
value: 55, | ||
}); | ||
}); | ||
}); | ||
|
||
describe("negative cases", () => { | ||
test("throws an error when stdout does not contain nice JSON", () => { | ||
const result = new Result({ | ||
index: 0, | ||
result: ResultState.Ok, | ||
stdout: "not json\n", | ||
stderr: null, | ||
message: null, | ||
isBatchFinished: true, | ||
eventDate: "2023-08-29T09:23:52.305095307Z", | ||
}); | ||
|
||
expect(() => result.getOutputAsJson()).toThrow("Failed to parse output to JSON!"); | ||
}); | ||
}); | ||
}); | ||
}); |
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
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
Oops, something went wrong.