Skip to content

Commit

Permalink
prettier --write '**/*.js'
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed May 11, 2021
1 parent 730b9b6 commit 6433b2e
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 370 deletions.
15 changes: 7 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ const expect = require('./createTopLevelExpect')()
.freeze();

// Add an inspect method to all the promises we return that will make the REPL, console.log, and util.inspect render it nicely in node.js:
require('unexpected-bluebird').prototype[
require('./nodeJsCustomInspect')
] = function () {
return expect
.createOutput(require('magicpen').defaultFormat)
.appendInspected(this)
.toString();
};
require('unexpected-bluebird').prototype[require('./nodeJsCustomInspect')] =
function () {
return expect
.createOutput(require('magicpen').defaultFormat)
.appendInspected(this)
.toString();
};

module.exports = expect;
3 changes: 2 additions & 1 deletion lib/specialCharRegExp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ const utils = (module.exports = {
if (diffItem.type === 'moveSource') {
diffItem.changeIndex = index;
(moveSourceAndTargetByActualIndex[diffItem.actualIndex] =
moveSourceAndTargetByActualIndex[diffItem.actualIndex] ||
{}).source = diffItem;
moveSourceAndTargetByActualIndex[diffItem.actualIndex] || {}).source =
diffItem;
} else if (diffItem.type === 'moveTarget') {
diffItem.changeIndex = index;
(moveSourceAndTargetByActualIndex[diffItem.actualIndex] =
moveSourceAndTargetByActualIndex[diffItem.actualIndex] ||
{}).target = diffItem;
moveSourceAndTargetByActualIndex[diffItem.actualIndex] || {}).target =
diffItem;
}
});
const moveIndices = Object.keys(moveSourceAndTargetByActualIndex);
Expand Down
6 changes: 2 additions & 4 deletions test/api/addAssertion.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,8 @@ describe('addAssertion', () => {
function () {
clonedExpect(
{
a:
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
b:
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
a: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
b: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
},
'to foobarbaz'
);
Expand Down
44 changes: 4 additions & 40 deletions test/api/inspect.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,46 +363,10 @@ describe('inspect', () => {
it('should render a hex dump for an Uint8Array instance', () => {
expect(
new Uint8Array([
0x00,
0x01,
0x02,
0x48,
0x65,
0x72,
0x65,
0x20,
0x69,
0x73,
0x20,
0x74,
0x68,
0x65,
0x20,
0x74,
0x68,
0x69,
0x6e,
0x67,
0x20,
0x49,
0x20,
0x77,
0x61,
0x73,
0x20,
0x74,
0x61,
0x6c,
0x6b,
0x69,
0x6e,
0x67,
0x20,
0x61,
0x62,
0x6f,
0x75,
0x74,
0x00, 0x01, 0x02, 0x48, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20,
0x74, 0x68, 0x65, 0x20, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x49,
0x20, 0x77, 0x61, 0x73, 0x20, 0x74, 0x61, 0x6c, 0x6b, 0x69, 0x6e,
0x67, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74,
]),
'to inspect as',
'Uint8Array([0x00, 0x01, 0x02, 0x48, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74 /* 24 more */ ])'
Expand Down
Loading

0 comments on commit 6433b2e

Please sign in to comment.