Skip to content

Commit

Permalink
always save outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyreilly committed Sep 20, 2020
1 parent cdc6ea6 commit 64689d2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/comparison-tests/create-and-execute-test.js
Expand Up @@ -268,10 +268,10 @@ function storeStats(stats, testState, paths) {

function compareFiles(paths, test, patch) {
if (saveOutputMode) {
const actualFiles = glob.sync('**/*', { cwd: paths.actualOutput, nodir: true, dot: true }),
expectedFiles = glob.sync('**/*', { cwd: paths.originalExpectedOutput, nodir: true, dot: true })
.filter(function (file) { return !/^patch/.test(file); }),
allFiles = {};
const actualFiles = glob.sync('**/*', { cwd: paths.actualOutput, nodir: true, dot: true });
const expectedFiles = glob.sync('**/*', { cwd: paths.originalExpectedOutput, nodir: true, dot: true })
.filter(function (file) { return !/^patch/.test(file); });
const allFiles = {};

actualFiles.forEach(function (file) { allFiles[file] = true });
expectedFiles.forEach(function (file) {
Expand All @@ -282,9 +282,11 @@ function compareFiles(paths, test, patch) {
Object.keys(allFiles).forEach(function (file) {
const actual = getNormalisedFileContent(file, paths.actualOutput);
const expected = getNormalisedFileContent(file, paths.expectedOutput);
if (actual !== expected) {

// I believe we always want to copy this
// if (actual !== expected) {
fs.copySync(path.join(paths.actualOutput, file), path.join(paths.originalExpectedOutput, file));
}
// }
});
}
else {
Expand Down

0 comments on commit 64689d2

Please sign in to comment.