Skip to content

Commit

Permalink
eslint --fix .
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Dec 31, 2018
1 parent f0d579d commit bd66568
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions lib/convertMarkdownToMocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ module.exports = function (mdSrc, fileName) {
var separator = '\n//---------------------um-separator---------------------\n';
var transpiledCode = transpile(preambleSeparator + codeBlocks.map(function (codeBlock) {
return codeBlock.flags.async
? '(function unexpectedMarkdownScope() {' +
? '(function unexpectedMarkdownScope() {' +
codeBlock.code +
'})("unexpectedMarkdownScope");'
: codeBlock.code;
: codeBlock.code;
}).join(separator));

var transpiledBlocks = transpiledCode
Expand Down
8 changes: 4 additions & 4 deletions lib/evaluateSnippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ module.exports = function (snippets, options, cb) {
if (exampleSnippets.length) {
var codeForTranspilation = preambleSeparator + exampleSnippets.map(function (snippet) {
return snippet.flags.async
? '(function () {' + snippet.code + '})();'
: snippet.code;
? '(function () {' + snippet.code + '})();'
: snippet.code;
}).join(separator);

var transpiledCode = transpile(codeForTranspilation);
Expand All @@ -92,8 +92,8 @@ module.exports = function (snippets, options, cb) {
if (snippet.flags.async) {
var promise = vm.runInThisContext(
hasBabel
? snippet.code
: '(function () {' + snippet.code + '})();'
? snippet.code
: '(function () {' + snippet.code + '})();'
);
if (!isPromise(promise)) {
throw new Error('Async code block did not return a promise or throw\n' + snippet.code);
Expand Down
50 changes: 25 additions & 25 deletions test/UnexpectedMarkdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ describe('UnexpectedMarkdown', function () {
var markdown;
beforeEach(function () {
markdown = new UnexpectedMarkdown([
"Asserts deep equality.",
"",
"```javascript",
'Asserts deep equality.',
'',
'```javascript',
"expect({ a: 'b' }, 'to equal', { a: 'b' });",
"var now = new Date();",
'var now = new Date();',
"expect(now, 'to equal', now);",
"expect(now, 'to equal', new Date(now.getTime()));",
"expect({ now: now }, 'to equal', { now: now });",
"```",
"",
"For a lot of types a failing equality test results in a nice",
"diff. Below you can see an object diff.",
"",
"```javascript",
'```',
'',
'For a lot of types a failing equality test results in a nice',
'diff. Below you can see an object diff.',
'',
'```javascript',
"expect({ text: 'foo!' }, 'to equal', { text: 'f00!' });",
"```",
"",
"```output",
"Missing output",
"```"
'```',
'',
'```output',
'Missing output',
'```'
].join('\n'));
});

Expand All @@ -44,12 +44,12 @@ describe('UnexpectedMarkdown', function () {

it('syntax highlight examples', function () {
return expect(htmlPromise, 'when fulfilled',
'to contain', '<span style="color: #000000">expect</span>');
'to contain', '<span style="color: #000000">expect</span>');
});

it('outputs evaluated examples', function () {
return expect(htmlPromise, 'when fulfilled',
'to contain', '<span style="background-color: green; color: white">f00</span>');
'to contain', '<span style="background-color: green; color: white">f00</span>');
});
});

Expand All @@ -69,16 +69,16 @@ describe('UnexpectedMarkdown', function () {

it('produces a markdown where the examples has been updated', function () {
return expect(updatedMarkdownPromise, 'when fulfilled', 'to contain', [
"```output",
'```output',
"expected { text: 'foo!' } to equal { text: 'f00!' }",
"",
"{",
'',
'{',
" text: 'foo!' // should equal 'f00!'",
" //",
" // -foo!",
" // +f00!",
"}",
"```"
' //',
' // -foo!',
' // +f00!',
'}',
'```'
].join('\n'));
});
});
Expand Down
12 changes: 6 additions & 6 deletions test/convertMarkdownToMocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ var synchronousSuccessfulSnippet =
var returningSuccessfulSnippet =
"var blah = 'abc';\n" +
"if (blah === 'abc') {\n" +
" return expect.promise(function (resolve, reject) {\n" +
" setImmediate(resolve);\n" +
" });\n" +
"} else {\n" +
" return 456;\n" +
"}\n";
' return expect.promise(function (resolve, reject) {\n' +
' setImmediate(resolve);\n' +
' });\n' +
'} else {\n' +
' return 456;\n' +
'}\n';

var synchronousThrowingSnippet =
"var bar = 'abc';\n" +
Expand Down

0 comments on commit bd66568

Please sign in to comment.