From 433b7b02a49fed7a105a526313f701449354f26e Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 3 Apr 2019 11:48:45 +0100 Subject: [PATCH] test(docs-infra): fix eslint warnings (#29673) ``` warning An "it" that uses an async method should handle failure (use "done.fail") jasmine/no-promise-without-done-fail ``` PR Close #29673 --- .../transforms/authors-package/index.spec.js | 40 ++++++++----------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/aio/tools/transforms/authors-package/index.spec.js b/aio/tools/transforms/authors-package/index.spec.js index fea8bfe4de..440bc400c1 100644 --- a/aio/tools/transforms/authors-package/index.spec.js +++ b/aio/tools/transforms/authors-package/index.spec.js @@ -23,70 +23,62 @@ describe('authors-package (integration tests)', () => { }); }); - it('should generate marketing docs if the "fileChanged" is a marketing doc', (done) => { - generateDocs('aio/content/marketing/about.html', { silent: true }).then(() => { + it('should generate marketing docs if the "fileChanged" is a marketing doc', () => { + return generateDocs('aio/content/marketing/about.html', { silent: true }).then(() => { expect(fs.writeFile).toHaveBeenCalled(); expect(files).toContain(resolve(DOCS_OUTPUT_PATH, 'about.json')); expect(files).toContain(resolve(DOCS_OUTPUT_PATH, '../navigation.json')); expect(files).toContain(resolve(DOCS_OUTPUT_PATH, '../contributors.json')); expect(files).toContain(resolve(DOCS_OUTPUT_PATH, '../resources.json')); - done(); }); }); - it('should generate tutorial docs if the "fileChanged" is a tutorial doc', (done) => { - generateDocs('aio/content/tutorial/toh-pt5.md', { silent: true }).then(() => { + it('should generate tutorial docs if the "fileChanged" is a tutorial doc', () => { + return generateDocs('aio/content/tutorial/toh-pt5.md', { silent: true }).then(() => { expect(fs.writeFile).toHaveBeenCalled(); expect(files).toContain(resolve(DOCS_OUTPUT_PATH, 'tutorial/toh-pt5.json')); - done(); }); }); - it('should generate tutorial docs if the "fileChanged" is the tutorial index', (done) => { - generateDocs('aio/content/tutorial/index.md', { silent: true }).then(() => { + it('should generate tutorial docs if the "fileChanged" is the tutorial index', () => { + return generateDocs('aio/content/tutorial/index.md', { silent: true }).then(() => { expect(fs.writeFile).toHaveBeenCalled(); expect(files).toContain(resolve(DOCS_OUTPUT_PATH, 'tutorial.json')); - done(); }); }); - it('should generate tutorial docs if the "fileChanged" is a tutorial example', (done) => { - generateDocs('aio/content/examples/toh-pt3/app/app.component.1.html', { silent: true }).then(() => { + it('should generate tutorial docs if the "fileChanged" is a tutorial example', () => { + return generateDocs('aio/content/examples/toh-pt3/app/app.component.1.html', { silent: true }).then(() => { expect(fs.writeFile).toHaveBeenCalled(); expect(files).toContain(resolve(DOCS_OUTPUT_PATH, 'tutorial/toh-pt3.json')); - done(); }); }); - it('should generate guide doc if the "fileChanged" is a guide doc', (done) => { - generateDocs('aio/content/guide/architecture.md', { silent: true }).then(() => { + it('should generate guide doc if the "fileChanged" is a guide doc', () => { + return generateDocs('aio/content/guide/architecture.md', { silent: true }).then(() => { expect(fs.writeFile).toHaveBeenCalled(); expect(files).toContain(resolve(DOCS_OUTPUT_PATH, 'guide/architecture.json')); - done(); }); }); - it('should generate guide doc if the "fileChanged" is a guide example', (done) => { - generateDocs('aio/content/examples/architecture/src/app/app.module.ts', { silent: true }).then(() => { + it('should generate guide doc if the "fileChanged" is a guide example', () => { + return generateDocs('aio/content/examples/architecture/src/app/app.module.ts', { silent: true }).then(() => { expect(fs.writeFile).toHaveBeenCalled(); expect(files).toContain(resolve(DOCS_OUTPUT_PATH, 'guide/architecture.json')); - done(); }); }); - it('should generate API doc if the "fileChanged" is an API doc', (done) => { - generateDocs('packages/forms/src/form_builder.ts', { silent: true }).then(() => { + it('should generate API doc if the "fileChanged" is an API doc', () => { + return generateDocs('packages/forms/src/form_builder.ts', { silent: true }).then(() => { expect(fs.writeFile).toHaveBeenCalled(); expect(files).toContain(resolve(DOCS_OUTPUT_PATH, 'api/forms/FormBuilder.json')); - done(); }); }, 16000); - it('should generate API doc if the "fileChanged" is an API example', (done) => { - generateDocs('packages/examples/forms/ts/formBuilder/form_builder_example.ts', { silent: true }).then(() => { + it('should generate API doc if the "fileChanged" is an API example', () => { + return generateDocs('packages/examples/forms/ts/formBuilder/form_builder_example.ts', { silent: true }).then(() => { expect(fs.writeFile).toHaveBeenCalled(); expect(files).toContain(resolve(DOCS_OUTPUT_PATH, 'api/forms/FormBuilder.json')); - done(); }); }, 16000); });