|
|
|
@ -96,7 +96,7 @@ describe("mooc_node-mod5_quiz_cmd", function () {
|
|
|
|
|
|
|
|
|
|
// replace answers file
|
|
|
|
|
[_, path_ok] = await to(fs.move(path.join(path_assignment, 'quizzes.json'), path.join(path_assignment, 'quizzes.original.json'), {"overwrite": true}));
|
|
|
|
|
[error_deps, path_ok] = await to(fs.move(path.join(path_assignment, 'tests', 'quizzes.json'), path.join(path_assignment, 'quizzes.json'), {"overwrite": true}));
|
|
|
|
|
[error_deps, path_ok] = await to(fs.copy(path.join(path_assignment, 'tests', 'quizzes.json'), path.join(path_assignment, 'quizzes.json'), {"overwrite": true}));
|
|
|
|
|
if (error_deps) {
|
|
|
|
|
this.msg_err = "Error copying the answers file: " + error_deps;
|
|
|
|
|
error_critical = this.msg_err;
|
|
|
|
@ -301,7 +301,7 @@ describe("mooc_node-mod5_quiz_cmd", function () {
|
|
|
|
|
should.not.exist(error_critical);
|
|
|
|
|
} else {
|
|
|
|
|
const input = ["play", "OK"];
|
|
|
|
|
const expected = "/1/";
|
|
|
|
|
const expected = /1/;
|
|
|
|
|
let output = "";
|
|
|
|
|
let error_std = "";
|
|
|
|
|
const client = spawn("node", ["main.js"], {cwd: path_assignment});
|
|
|
|
@ -327,6 +327,7 @@ describe("mooc_node-mod5_quiz_cmd", function () {
|
|
|
|
|
}
|
|
|
|
|
this.msg_ok = `Found '${expected}' in ${path_assignment}`;
|
|
|
|
|
this.msg_err = `Couldn't find '${expected}' in ${path_assignment}\nError:${error_std}\nReceived:${output}`;
|
|
|
|
|
console.log(expected, "OUT", output);
|
|
|
|
|
error_std.should.be.equal("");
|
|
|
|
|
Utils.search(expected, output).should.be.equal(true);
|
|
|
|
|
}
|
|
|
|
@ -411,4 +412,4 @@ describe("mooc_node-mod5_quiz_cmd", function () {
|
|
|
|
|
after("Restoring the original file", async function () {
|
|
|
|
|
[error_copy, path_ok] = await to(fs.move(path.join(path_assignment, 'quizzes.original.json'), path.join(path_assignment, 'quizzes.json'), {"overwrite": true}));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|