-
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 remote-tracking branch 'origin/master' into beta
- Loading branch information
Showing
33 changed files
with
547 additions
and
159 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 |
---|---|---|
|
@@ -19,7 +19,8 @@ | |
"external-request": "ts-node ./external-request/request.ts", | ||
"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
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!"); | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.