Closed jbalsas closed 7 years ago
In tests with skipFileOverride: false, we use the following construction to make sure we restore the original files:
skipFileOverride: false
var tmpFileName = path.join(path.resolve(__dirname, 'modal'), 'namespace-define-custom.es.tmp.js'); fs.copy(path.resolve(__dirname, 'modal/js/namespace-define-custom.es.js'), tmpFileName, function(error) { if (error) { throw error; } var configGenerator = new ConfigGenerator({...}); configGenerator.process().then(function(config) { // assertions fs.remove(tmpFileName, function() { done(); }); }); });
If the test fails, the tmpFile will not be removed, showing as an untracked file
In tests with
skipFileOverride: false
, we use the following construction to make sure we restore the original files:If the test fails, the tmpFile will not be removed, showing as an untracked file