-
Notifications
You must be signed in to change notification settings - Fork 6
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 #375 from kleros/chore/initialize-relayer-testing
test(relayer): adds initial testing base
- Loading branch information
Showing
8 changed files
with
2,105 additions
and
437 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
coverage |
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,10 @@ | ||
import type { Config } from "jest"; | ||
|
||
const config: Config = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
collectCoverage: true, | ||
collectCoverageFrom: ["**/*.ts"], | ||
}; | ||
|
||
export default config; |
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,36 @@ | ||
import ShutdownManager from "./shutdownManager"; | ||
|
||
describe("ShutdownManager", () => { | ||
describe("constructor", () => { | ||
it("should create a new instance", () => { | ||
const instance = new ShutdownManager(); | ||
expect(instance).toBeInstanceOf(ShutdownManager); | ||
}); | ||
|
||
it("should set isShuttingDown to the provided value", () => { | ||
const instance = new ShutdownManager(true); | ||
expect(instance["isShuttingDown"]).toBe(true); | ||
}); | ||
|
||
it("should set isShuttingDown to false if no value is provided", () => { | ||
const instance = new ShutdownManager(); | ||
expect(instance["isShuttingDown"]).toBe(false); | ||
}); | ||
}); | ||
|
||
describe("getIsShuttingDown", () => { | ||
it("should return true when isShuttingDown is true", () => { | ||
const instance = new ShutdownManager(true); | ||
expect(instance.getIsShuttingDown()).toBe(true); | ||
}); | ||
|
||
it("should return false when isShuttingDown is false", () => { | ||
const instance = new ShutdownManager(false); | ||
expect(instance.getIsShuttingDown()).toBe(false); | ||
}); | ||
}); | ||
|
||
describe("triggerShutdown", () => { | ||
it.todo("should set isShuttingDown to true"); | ||
}); | ||
}); |
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,15 @@ | ||
export default class ShutdownManager { | ||
private isShuttingDown: boolean; | ||
|
||
constructor(initialState: boolean = false) { | ||
this.isShuttingDown = initialState; | ||
} | ||
|
||
public getIsShuttingDown(): boolean { | ||
return this.isShuttingDown; | ||
} | ||
|
||
public triggerShutdown() { | ||
this.isShuttingDown = true; | ||
} | ||
} |
Oops, something went wrong.