From e865fdebeb51a63c9f08c05f8e8fe6a985d2e030 Mon Sep 17 00:00:00 2001 From: Sune Simonsen Date: Wed, 28 Mar 2018 17:34:28 +0200 Subject: [PATCH] Revert "Tweaking output of the to satisfy on style" This reverts commit a66edd723cc6708e403a68202966174e896dd095. --- lib/index.js | 11 ++++++----- test/index.spec.js | 8 ++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/index.js b/lib/index.js index a695fa31..badbe580 100644 --- a/lib/index.js +++ b/lib/index.js @@ -696,7 +696,6 @@ module.exports = { if (typeof value === 'string') { value = getClassNamesFromAttributeValue(value); } - return topLevelExpect( actualClasses.sort(), 'to equal', @@ -1010,7 +1009,6 @@ module.exports = { expectedAttributeNames.push(attributeName); }); - expect.errorMode = 'diff'; expectedAttributeNames.forEach(function(attributeName) { var attributeValue = subject.getAttribute(attributeName); var expectedAttributeValue = @@ -1053,13 +1051,17 @@ module.exports = { } if (onlyAttributes) { - return expect( + return topLevelExpect( attrs.style, 'to exhaustively satisfy', expectedStyleObj ); } else { - return expect(attrs.style, 'to satisfy', expectedStyleObj); + return topLevelExpect( + attrs.style, + 'to satisfy', + expectedStyleObj + ); } } else if (expectedAttributeValue === true) { topLevelExpect( @@ -1080,7 +1082,6 @@ module.exports = { } }); }); - expect.errorMode = 'default'; promiseByKey.attributePresence = expect.promise(function() { var attributeNamesExpectedToBeDefined = []; diff --git a/test/index.spec.js b/test/index.spec.js index 250fedd8..15a1345b 100644 --- a/test/index.spec.js +++ b/test/index.spec.js @@ -1617,7 +1617,9 @@ describe('unexpected-dom', function() { 'expected
hey
to satisfy
hey
\n' + '\n' + 'hey to satisfy
hey
\n' + '\n' + '