Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('Runs successfully with XML variable substitution', (done:MochaDone) => {
let tp = path.join(__dirname, "..", "node_modules", "webdeployment-common-v2", "Tests", 'L1XmlVarSub.js');
let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();
var resultFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules","webdeployment-common-v2","Tests", 'L1XmlVarSub', 'Web_test.config')));
var expectFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules","webdeployment-common-v2","Tests", 'L1XmlVarSub', 'Web_Expected.config')));
assert(ltx.equal(resultFile, expectFile) , 'Should have substituted variables in Web.config file');
var resultFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules", "webdeployment-common-v2", "Tests", 'L1XmlVarSub', 'Web_test.Debug.config')));
var expectFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules", "webdeployment-common-v2", "Tests", 'L1XmlVarSub', 'Web_Expected.Debug.config')));
assert(ltx.equal(resultFile, expectFile) , 'Should have substituted variables in Web.Debug.config file');
var resultParamFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules","webdeployment-common-v2","Tests", 'L1XmlVarSub', 'parameters_test.xml')));
var expectParamFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules","webdeployment-common-v2","Tests", 'L1XmlVarSub', 'parameters_Expected.xml')));
assert(ltx.equal(resultParamFile, expectParamFile) , 'Should have substituted variables in parameters.xml file');
done();
});
it('Runs successfully with XDT Transformation (L1)', (done:MochaDone) => {
this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000);
let tp = path.join(__dirname, "..", "node_modules","webdeployment-common-v2","Tests","L1XdtTransform.js");
let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();
if(tl.osType().match(/^Win/)) {
var resultFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules","webdeployment-common-v2","Tests", 'L1XdtTransform', 'Web_test.config')));
var expectFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules","webdeployment-common-v2","Tests", 'L1XdtTransform','Web_Expected.config')));
assert(ltx.equal(resultFile, expectFile) , 'Should Transform attributes on Web.config');
}
else {
tl.warning('Cannot test XDT Transformation in Non Windows Agent');
}
done();
});
it('Runs successfully with XML variable substitution', (done:MochaDone) => {
let tp = path.join(__dirname, "..", "node_modules", "webdeployment-common-v2", "Tests", 'L1XmlVarSub.js');
let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();
var resultFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules","webdeployment-common-v2","Tests", 'L1XmlVarSub', 'Web_test.config')));
var expectFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules","webdeployment-common-v2","Tests", 'L1XmlVarSub', 'Web_Expected.config')));
assert(ltx.equal(resultFile, expectFile) , 'Should have substituted variables in Web.config file');
var resultFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules", "webdeployment-common-v2", "Tests", 'L1XmlVarSub', 'Web_test.Debug.config')));
var expectFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules", "webdeployment-common-v2", "Tests", 'L1XmlVarSub', 'Web_Expected.Debug.config')));
assert(ltx.equal(resultFile, expectFile) , 'Should have substituted variables in Web.Debug.config file');
var resultParamFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules","webdeployment-common-v2","Tests", 'L1XmlVarSub', 'parameters_test.xml')));
var expectParamFile = ltx.parse(fs.readFileSync(path.join(__dirname, "..", "node_modules","webdeployment-common-v2","Tests", 'L1XmlVarSub', 'parameters_Expected.xml')));
assert(ltx.equal(resultParamFile, expectParamFile) , 'Should have substituted variables in parameters.xml file');
done();
});