@salesforce/templates
Version:
Salesforce JS library for templates
38 lines • 1.65 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
/*
* Copyright (c) 2019, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
const path = require("path");
const i18n_1 = require("../i18n");
const utils_1 = require("../utils");
const baseGenerator_1 = require("./baseGenerator");
class LightningTestGenerator extends baseGenerator_1.BaseGenerator {
constructor(options) {
super(options);
}
validateOptions() {
utils_1.CreateUtil.checkInputs(this.options.testname);
utils_1.CreateUtil.checkInputs(this.options.template);
}
generate() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const { template, testname, internal } = this.options;
this.sourceRootWithPartialPath('lightningtest');
if (!internal) {
yield this.render(this.templatePath('_staticresource.resource-meta.xml'), this.destinationPath(path.join(this.outputdir, `${testname}.resource-meta.xml`)), {
description: i18n_1.nls.localize('LightningTest'),
},
// @ts-ignore
{ apiName: testname });
}
yield this.render(this.templatePath(`${template}.resource`), this.destinationPath(path.join(this.outputdir, `${testname}.resource`)), { apiName: testname });
});
}
}
exports.default = LightningTestGenerator;
//# sourceMappingURL=lightningTestGenerator.js.map
;