mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
58 lines
1.1 KiB
TypeScript
58 lines
1.1 KiB
TypeScript
// Mock for isolated-vm native module (not loadable in Jest)
|
|
export class Isolate {
|
|
public isDisposed: boolean = false;
|
|
public async createContext(): Promise<Context> {
|
|
return new Context();
|
|
}
|
|
public dispose(): void {
|
|
this.isDisposed = true;
|
|
}
|
|
}
|
|
|
|
export class Context {
|
|
public global: Reference = new Reference();
|
|
public async eval(_code: string, _options?: unknown): Promise<unknown> {
|
|
return undefined;
|
|
}
|
|
}
|
|
|
|
export class Reference {
|
|
public async set(_key: string, _value: unknown): Promise<void> {
|
|
return;
|
|
}
|
|
public derefInto(): unknown {
|
|
return {};
|
|
}
|
|
public applySync(
|
|
_receiver: unknown,
|
|
_args: unknown[],
|
|
): unknown {
|
|
return undefined;
|
|
}
|
|
public applySyncPromise(
|
|
_receiver: unknown,
|
|
_args: unknown[],
|
|
): Promise<unknown> {
|
|
return Promise.resolve(undefined);
|
|
}
|
|
}
|
|
|
|
export class Callback {
|
|
constructor(_fn: (...args: unknown[]) => void) {}
|
|
}
|
|
|
|
export class ExternalCopy {
|
|
constructor(_value: unknown) {}
|
|
public copyInto(): unknown {
|
|
return {};
|
|
}
|
|
}
|
|
|
|
export default {
|
|
Isolate,
|
|
Context,
|
|
Reference,
|
|
Callback,
|
|
ExternalCopy,
|
|
};
|