refactor: migrate to screeps-api v2 and update actions to node 22
Test / Run Tests (push) Failing after 1s
Recompile dist/ on Renovate PR / recompile (pull_request) Failing after 0s
Test / Run Tests (pull_request) Failing after 0s
Philipp/Global-Workflows: Pre-commit Lint (Scoped) / pre-commit (pull_request) Failing after 1s

This commit is contained in:
2026-09-04 23:56:04 +02:00
parent d644b19b47
commit cfb97819ae
8 changed files with 68 additions and 33 deletions
+13 -5
View File
@@ -382,13 +382,21 @@ function buildMockApi({
disconnect: vi.fn(),
};
const getTime = vi.fn().mockImplementation(() => {
const t = ticks[Math.min(tickIndex, ticks.length - 1)];
tickIndex++;
return Promise.resolve({ time: t });
});
const api = {
opts: { hostname },
time: vi.fn().mockImplementation(() => {
const t = ticks[Math.min(tickIndex, ticks.length - 1)];
tickIndex++;
return Promise.resolve({ time: t });
}),
time: getTime,
get gameTime() {
return this.time;
},
set gameTime(fn) {
this.time = fn;
},
socket,
// Expose so tests can fire console events
_fireConsole: (eventData) => {