mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
import { expect, test } from "bun:test";
|
|
import perf from "perf_hooks";
|
|
|
|
test("stubs", () => {
|
|
expect(!!perf.monitorEventLoopDelay).toBeFalse();
|
|
expect(() => perf.monitorEventLoopDelay()).toThrow();
|
|
expect(perf.performance.nodeTiming).toBeObject();
|
|
|
|
expect(perf.performance.now()).toBeNumber();
|
|
expect(perf.performance.timeOrigin).toBeNumber();
|
|
expect(perf.performance.eventLoopUtilization()).toBeObject();
|
|
});
|
|
|
|
test("doesn't throw", () => {
|
|
expect(() => performance.mark("test")).not.toThrow();
|
|
expect(() => performance.measure("test", "test")).not.toThrow();
|
|
expect(() => performance.clearMarks()).not.toThrow();
|
|
expect(() => performance.clearMeasures()).not.toThrow();
|
|
expect(() => performance.getEntries()).not.toThrow();
|
|
expect(() => performance.getEntriesByName("test")).not.toThrow();
|
|
expect(() => performance.getEntriesByType("measure")).not.toThrow();
|
|
expect(() => performance.now()).not.toThrow();
|
|
expect(() => performance.timeOrigin).not.toThrow();
|
|
expect(() => performance.markResourceTiming()).not.toThrow();
|
|
});
|