UNPKG

2.26 kBJavaScriptView Raw
1"use strict";
2var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3 if (k2 === undefined) k2 = k;
4 var desc = Object.getOwnPropertyDescriptor(m, k);
5 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6 desc = { enumerable: true, get: function() { return m[k]; } };
7 }
8 Object.defineProperty(o, k2, desc);
9}) : (function(o, m, k, k2) {
10 if (k2 === undefined) k2 = k;
11 o[k2] = m[k];
12}));
13var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14 Object.defineProperty(o, "default", { enumerable: true, value: v });
15}) : function(o, v) {
16 o["default"] = v;
17});
18var __importStar = (this && this.__importStar) || function (mod) {
19 if (mod && mod.__esModule) return mod;
20 var result = {};
21 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22 __setModuleDefault(result, mod);
23 return result;
24};
25Object.defineProperty(exports, "__esModule", { value: true });
26exports.expectNativeModuleToNotBeRebuilt = exports.expectNativeModuleToBeRebuilt = void 0;
27const chai_1 = require("chai");
28const fs = __importStar(require("fs-extra"));
29const path = __importStar(require("path"));
30async function expectNativeModuleToBeRebuilt(basePath, modulePath, options = {}) {
31 const metaShouldExist = Object.prototype.hasOwnProperty.call(options, 'metaShouldExist') ? options.metaShouldExist : true;
32 const message = `${path.basename(modulePath)} build meta should ${metaShouldExist ? '' : 'not '}exist`;
33 const buildType = options.buildType || 'Release';
34 const metaPath = path.resolve(basePath, 'node_modules', modulePath, 'build', buildType, '.forge-meta');
35 (0, chai_1.expect)(await fs.pathExists(metaPath), message).to.equal(metaShouldExist);
36}
37exports.expectNativeModuleToBeRebuilt = expectNativeModuleToBeRebuilt;
38async function expectNativeModuleToNotBeRebuilt(basePath, modulePath, options = {}) {
39 await expectNativeModuleToBeRebuilt(basePath, modulePath, { ...options, metaShouldExist: false });
40}
41exports.expectNativeModuleToNotBeRebuilt = expectNativeModuleToNotBeRebuilt;
42//# sourceMappingURL=rebuild.js.map
\No newline at end of file