Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const tempTestDirectory = path.join(tempDirectory, testCase);
let pre;
try {
/* eslint-disable global-require */
pre = require(path.join(cwd, task, testCase, 'pre.js'));
/* eslint-enable global-require */
} catch {
pre = async function () {
// Dummy method as fallback
};
}
buntstift.line();
buntstift.info(`${task} - ${testCase}`);
buntstift.newLine();
await pre({ dirname: tempTestDirectory });
const result = await runRoboterTask({ cwd, task, directory: tempTestDirectory });
/* eslint-disable global-require */
const expected = require(path.join(cwd, task, testCase, 'expected.js'));
/* eslint-enable global-require */
assert.that(result.exitCode).is.equalTo(expected.exitCode);
assert.that(result.stderr).is.containing(expected.stderr);
const expectedStdouts = flatten([ expected.stdout ]);