From 9ab1f4a9c965c2ca099dd2097be185731677228b Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Wed, 25 Oct 2017 15:02:01 +0100 Subject: [PATCH] style(aio): fix docs linting issues (#19702) These issues appeared after upgrade of eslint jasmine plugin PR Close #19702 --- aio/tools/transforms/.eslintrc.js | 3 ++- .../post-processors/add-image-dimensions.spec.js | 4 ++-- .../angular-base-package/processors/convertToJson.spec.js | 2 +- aio/tools/transforms/authors-package/index.spec.js | 1 + .../post-process-package/processors/post-process-html.spec.js | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/aio/tools/transforms/.eslintrc.js b/aio/tools/transforms/.eslintrc.js index f82f5d54c0..9d2b6792c2 100644 --- a/aio/tools/transforms/.eslintrc.js +++ b/aio/tools/transforms/.eslintrc.js @@ -15,6 +15,7 @@ module.exports = { 'indent': ['error', 2], 'linebreak-style': ['error', 'unix'], 'quotes': ['error', 'single'], - 'semi': ['error', 'always'] + 'semi': ['error', 'always'], + 'jasmine/new-line-before-expect': 0 } }; diff --git a/aio/tools/transforms/angular-base-package/post-processors/add-image-dimensions.spec.js b/aio/tools/transforms/angular-base-package/post-processors/add-image-dimensions.spec.js index 411984a889..9c21f3ac86 100644 --- a/aio/tools/transforms/angular-base-package/post-processors/add-image-dimensions.spec.js +++ b/aio/tools/transforms/angular-base-package/post-processors/add-image-dimensions.spec.js @@ -55,7 +55,7 @@ describe('addImageDimensions post-processor', () => { docType: 'a', renderedContent: '' })]); - expect(log.warn).toHaveBeenCalled(); + expect(log.warn).toHaveBeenCalledWith('Missing src in image tag `` - doc (a) '); }); it('should fail for images whose source cannot be loaded', () => { @@ -69,7 +69,7 @@ describe('addImageDimensions post-processor', () => { renderedContent: '' }]; expect(() => processor.$process(docs)).toThrowError('Unable to load src in image tag `` - doc (a) '); - expect(getImageDimensionsSpy).toHaveBeenCalled(); + expect(getImageDimensionsSpy).toHaveBeenCalledWith('base/path', 'missing'); }); it('should ignore images with width or height attributes', () => { diff --git a/aio/tools/transforms/angular-base-package/processors/convertToJson.spec.js b/aio/tools/transforms/angular-base-package/processors/convertToJson.spec.js index 355097cda0..b68f1527de 100644 --- a/aio/tools/transforms/angular-base-package/processors/convertToJson.spec.js +++ b/aio/tools/transforms/angular-base-package/processors/convertToJson.spec.js @@ -70,6 +70,6 @@ describe('convertToJson processor', () => { it('should log a warning', () => { const docs = [{ docType: 'test-doc' }]; processor.$process(docs); - expect(log.warn).toHaveBeenCalled(); + expect(log.warn).toHaveBeenCalledWith('Title property expected - doc (test-doc) '); }); }); \ No newline at end of file diff --git a/aio/tools/transforms/authors-package/index.spec.js b/aio/tools/transforms/authors-package/index.spec.js index e08d0dd5bf..333f86040d 100644 --- a/aio/tools/transforms/authors-package/index.spec.js +++ b/aio/tools/transforms/authors-package/index.spec.js @@ -1,3 +1,4 @@ +/* eslint jasmine/prefer-toHaveBeenCalledWith:0 */ const fs = require('fs'); const {resolve} = require('canonical-path'); const {generateDocs} = require('./index.js'); diff --git a/aio/tools/transforms/post-process-package/processors/post-process-html.spec.js b/aio/tools/transforms/post-process-package/processors/post-process-html.spec.js index 9516f0714d..f6423bf598 100644 --- a/aio/tools/transforms/post-process-package/processors/post-process-html.spec.js +++ b/aio/tools/transforms/post-process-package/processors/post-process-html.spec.js @@ -68,7 +68,7 @@ describe('postProcessHtml', function() { }; processor.plugins = [() => addWarning]; processor.$process([{ docType: 'a', renderedContent: '' }]); - expect(log.warn).toHaveBeenCalled(); + expect(log.warn).toHaveBeenCalledWith('There was a problem - doc (a) '); }); it('should throw on fatal errors', () => {