Skip to content

Commit

Permalink
Use the output from the expect of the UnexpectedError instead of the …
Browse files Browse the repository at this point in the history
…top-level one

Fixes update-examples that relies on eg. styles defined by
magicpen-media in an expect.child
  • Loading branch information
papandreou committed Jan 3, 2020
1 parent 18ec4aa commit 90b3df3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/evaluateSnippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ function isPromise(value) {
function getErrorMessage(expect, format, error) {
if (error) {
if (error.getErrorMessage) {
var output = expect.createOutput
? expect.createOutput(format)
: expect.output.clone(format);
var expectForOutput = error.expect || expect;
var output = expectForOutput.createOutput
? expectForOutput.createOutput(format)
: expectForOutput.output.clone(format);
return error.getErrorMessage({ output: output }).toString(format);
} else if (error.output) {
return error.output.toString(format);
Expand Down

0 comments on commit 90b3df3

Please sign in to comment.