mirror of
https://github.com/geoffsee/open-gsio.git
synced 2025-09-08 22:56:46 +00:00
adds eslint
This commit is contained in:

committed by
Geoff Seemueller

parent
9698fc6f3b
commit
02c3253343
@@ -1,5 +1,7 @@
|
||||
import { type Instance } from 'mobx-state-tree';
|
||||
import { renderPage } from 'vike/server';
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import { getSnapshot, Instance } from 'mobx-state-tree';
|
||||
|
||||
import AssetService from '../services/AssetService.ts';
|
||||
|
||||
// Define types for testing
|
||||
@@ -11,29 +13,31 @@ vi.mock('vike/server', () => ({
|
||||
}));
|
||||
|
||||
// Import the mocked renderPage function for assertions
|
||||
import { renderPage } from 'vike/server';
|
||||
|
||||
// Mock global types
|
||||
vi.stubGlobal('ReadableStream', class MockReadableStream {});
|
||||
vi.stubGlobal('Response', class MockResponse {
|
||||
status: number;
|
||||
headers: Headers;
|
||||
body: any;
|
||||
vi.stubGlobal(
|
||||
'Response',
|
||||
class MockResponse {
|
||||
status: number;
|
||||
headers: Headers;
|
||||
body: any;
|
||||
|
||||
constructor(body?: any, init?: ResponseInit) {
|
||||
this.body = body;
|
||||
this.status = init?.status || 200;
|
||||
this.headers = new Headers(init?.headers);
|
||||
}
|
||||
constructor(body?: any, init?: ResponseInit) {
|
||||
this.body = body;
|
||||
this.status = init?.status || 200;
|
||||
this.headers = new Headers(init?.headers);
|
||||
}
|
||||
|
||||
clone() {
|
||||
return this;
|
||||
}
|
||||
clone() {
|
||||
return this;
|
||||
}
|
||||
|
||||
async text() {
|
||||
return this.body?.toString() || '';
|
||||
}
|
||||
});
|
||||
async text() {
|
||||
return this.body?.toString() || '';
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
describe('AssetService', () => {
|
||||
let assetService: AssetServiceInstance;
|
||||
|
Reference in New Issue
Block a user