All files / repo-tools/src/test-utils/env mock-endoify.ts

92.3% Statements 12/13
100% Branches 0/0
75% Functions 3/4
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37          131x   131x 27582x   6442x 131x                       131x     131x     131x   131x 43x        
// eslint-disable-next-line spaced-comment
/// <reference types="ses"/>
 
import { vi } from 'vitest';
 
import { makePromiseKitMock } from '../promise-kit.ts';
 
globalThis.lockdown = vi.fn((): void => undefined);
globalThis.harden = vi.fn(<Value>(value: Value): Readonly<Value> => value);
 
const assertFn = vi.fn((): void => undefined);
Object.assign(assertFn, {
  typeof: vi.fn(),
  error: vi.fn(),
  fail: vi.fn(),
  equal: vi.fn(),
  string: vi.fn(),
  note: vi.fn(),
  details: vi.fn(),
  Fail: vi.fn(),
  quote: vi.fn(),
  makeAssert: vi.fn(),
});
globalThis.assert = assertFn as unknown as typeof assert;
 
// @ts-expect-error: Mocks are lies
globalThis.HandledPromise = Promise;
 
// @ts-expect-error: Mocks are lies
globalThis.Compartment ??= vi.fn();
 
vi.mock('@endo/promise-kit', async () => {
  return makePromiseKitMock();
});
 
export {};