Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions packages/evm-state/source/service-provider.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Identifiers } from "@mainsail/constants";

import { Application } from "@mainsail/kernel";

import { describe } from "@mainsail/test-runner";
import { ServiceProvider } from "./service-provider";

describe<{
app: Application;
serviceProvider: ServiceProvider;
}>("ServiceProvider", ({ beforeEach, it, assert }) => {
beforeEach((context) => {
const app = new Application();

context.serviceProvider = app.resolve(ServiceProvider);
context.app = app;
});

it("#register - should be ok", async ({ serviceProvider, app }) => {
await serviceProvider.register();

assert.true(app.isBound(Identifiers.Evm.State));
});
});
23 changes: 23 additions & 0 deletions packages/evm-state/source/state.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Application } from "@mainsail/kernel";
import type { Contracts } from "@mainsail/contracts";

import { describe } from "@mainsail/test-runner";
import { State } from "./state";

describe<{
state: Contracts.Evm.State;
}>("ServiceProvider", ({ beforeEach, it, assert }) => {
beforeEach((context) => {
const app = new Application();
context.state = app.resolve(State);
});

it("#peerCount - should have default value 0", async ({ state }) => {
assert.equal(state.peerCount, 0);
});

it("#peerCount - should be set and read", async ({ state }) => {
state.peerCount = 5;
assert.equal(state.peerCount, 5);
});
});
Loading