From a0f605bbab910a53255e1e4410104d57b54de54a Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 18 Jan 2015 12:12:58 +1100 Subject: [PATCH] add way to automatically write expected tests --- test/_transformation-helper.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/_transformation-helper.js b/test/_transformation-helper.js index db754ac9ec..c036440f9e 100644 --- a/test/_transformation-helper.js +++ b/test/_transformation-helper.js @@ -94,7 +94,12 @@ var run = function (task, done) { checkAst(result); actualCode = result.code; - chai.expect(actualCode).to.be.equal(expectCode, actual.loc + " !== " + expect.loc); + try { + chai.expect(actualCode).to.be.equal(expectCode, actual.loc + " !== " + expect.loc); + } catch (err) { + //require("fs").writeFileSync(expect.loc, actualCode); + throw err; + } } if (task.sourceMap) {