0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-11 22:59:41 -04:00
deno/cli/tests/unit/ops_test.ts
Bartek Iwańczuk e8989a3a22 refactor: don't expose ops to user code (#22273)
Brings the number of ops exposed to user code down to 58.
2024-02-08 14:56:46 +05:30

17 lines
475 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
const EXPECTED_OP_COUNT = 58;
Deno.test(function checkExposedOps() {
// @ts-ignore TS doesn't allow to index with symbol
const core = Deno[Deno.internal].core;
const opNames = Object.keys(core.ops);
if (opNames.length !== EXPECTED_OP_COUNT) {
throw new Error(
`Expected ${EXPECTED_OP_COUNT} ops, but got ${opNames.length}:\n${
opNames.join("\n")
}`,
);
}
});