refactor: migrate to screeps-api v2 and update actions to node 22
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user