Fix CRLF issues in tests; Include common tsc options in asc bundle

This commit is contained in:
dcodeIO
2018-02-10 18:34:29 +01:00
parent 9678ce839e
commit 74f8189ac1
6 changed files with 116 additions and 121 deletions

View File

@ -69,12 +69,12 @@ tests.forEach(filename => {
console.log();
if (err)
stderr.write(err + os.EOL);
var actual = stdout.toString().replace(/\r\n/g, "\n");
if (args.create) {
fs.writeFileSync(path.join(basedir, basename + ".wast"), stdout.toString(), { encoding: "utf8" });
fs.writeFileSync(path.join(basedir, basename + ".wast"), actual, { encoding: "utf8" });
console.log("- " + chalk.yellow("Created fixture"));
} else {
let actual = stdout.toString();
let expected = fs.readFileSync(path.join(basedir, basename + ".wast"), { encoding: "utf8" });
let expected = fs.readFileSync(path.join(basedir, basename + ".wast"), { encoding: "utf8" }).replace(/\r\n/g, "\n");
let diffs = diff(basename + ".wast", expected, actual);
if (diffs !== null) {
console.log(diffs);