Change fetch implementation passing
This commit is contained in:
parent
03d0b7e025
commit
198ac93c8c
2 changed files with 23 additions and 16 deletions
|
|
@ -16,11 +16,17 @@ export class MockClient implements FileSystemOperations {
|
|||
protected readonly useSlowFileEvents: boolean
|
||||
) {}
|
||||
|
||||
public async init(): Promise<void> {
|
||||
this.client = await SyncClient.create(this, {
|
||||
load: async () => this.data,
|
||||
save: async (data) => void (this.data = data)
|
||||
});
|
||||
public async init(
|
||||
fetchImplementation: typeof globalThis.fetch
|
||||
): Promise<void> {
|
||||
this.client = await SyncClient.create(
|
||||
this,
|
||||
{
|
||||
load: async () => this.data,
|
||||
save: async (data) => void (this.data = data)
|
||||
},
|
||||
fetchImplementation
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
Object.keys(this.initialSettings).map(async (key) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue