19 lines
1.2 KiB
JavaScript
19 lines
1.2 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.expectNativeModuleToNotBeRebuilt = exports.expectNativeModuleToBeRebuilt = void 0;
|
|
const chai_1 = require("chai");
|
|
const fs = require("fs-extra");
|
|
const path = require("path");
|
|
async function expectNativeModuleToBeRebuilt(basePath, modulePath, options = {}) {
|
|
const metaShouldExist = Object.prototype.hasOwnProperty.call(options, 'metaShouldExist') ? options.metaShouldExist : true;
|
|
const message = `${path.basename(modulePath)} build meta should ${metaShouldExist ? '' : 'not '}exist`;
|
|
const buildType = options.buildType || 'Release';
|
|
const metaPath = path.resolve(basePath, 'node_modules', modulePath, 'build', buildType, '.forge-meta');
|
|
chai_1.expect(await fs.pathExists(metaPath), message).to.equal(metaShouldExist);
|
|
}
|
|
exports.expectNativeModuleToBeRebuilt = expectNativeModuleToBeRebuilt;
|
|
async function expectNativeModuleToNotBeRebuilt(basePath, modulePath, options = {}) {
|
|
await expectNativeModuleToBeRebuilt(basePath, modulePath, { ...options, metaShouldExist: false });
|
|
}
|
|
exports.expectNativeModuleToNotBeRebuilt = expectNativeModuleToNotBeRebuilt;
|
|
//# sourceMappingURL=rebuild.js.map
|