mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
* Update perf_hooks.ts * Update perf_hooks.test.ts --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
25 lines
992 B
TypeScript
25 lines
992 B
TypeScript
import perf from "perf_hooks";
|
|
import { test, expect } from "bun:test";
|
|
|
|
test("stubs", () => {
|
|
expect(() => perf.monitorEventLoopDelay()).toThrow();
|
|
expect(() => perf.createHistogram()).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();
|
|
});
|