-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.integ.test.ts
More file actions
34 lines (30 loc) · 965 Bytes
/
index.integ.test.ts
File metadata and controls
34 lines (30 loc) · 965 Bytes
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
/* eslint-disable @typescript-eslint/no-var-requires */
export {}; // Make this a module
beforeEach(() => {
jest.resetModules();
});
describe("with bindings", () => {
it("should be bound", () => {
const isBound = require("..").isBound as boolean;
expect(isBound).toBe(true);
});
});
describe("without bindings", () => {
const initialEnv = process.env;
beforeAll(() => {
process.env.npm_config_arch = "unknown";
// Prevent node-gyp from falling back to a local version of the native core in packages/core/build
process.env.PREBUILDS_ONLY = "1";
});
afterAll(() => {
process.env = initialEnv;
});
it("should not be bound", () => {
const isBound = require("..").isBound as boolean;
expect(isBound).toBe(false);
});
it("should throw when calling setupCore", () => {
const setupCore = require("..").setupCore as () => unknown;
expect(setupCore).toThrowError("Native core module is not bound");
});
});