From 780682a8f7e2b382d211cfbfc19311859eb3a8da Mon Sep 17 00:00:00 2001 From: Tom Hunkapiller Date: Thu, 20 May 2021 05:03:12 +0300 Subject: [PATCH] add test for ExternalStylesFactory when styles element is missing, to bump coverage --- src/file/styles/external-styles-factory.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/file/styles/external-styles-factory.spec.ts b/src/file/styles/external-styles-factory.spec.ts index 4db0f3199e..2ddc849ae8 100644 --- a/src/file/styles/external-styles-factory.spec.ts +++ b/src/file/styles/external-styles-factory.spec.ts @@ -153,6 +153,12 @@ describe("External styles factory", () => { }); }); + it("should throw when style element isn't found", () => { + expect(() => new ExternalStylesFactory().newInstance(``)).to.throw( + "can not find styles element", + ); + }); + it("should parse styles elements", () => { // tslint:disable-next-line:no-any const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any;