From 5cec4820bac8f89764795ed8fb84450ebe6fbbb2 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 22 Nov 2024 23:46:12 +0000 Subject: [PATCH] =?UTF-8?q?test:=20add=20TestHost=20setup=20and=20remove?= =?UTF-8?q?=20strict=20assertions=20=F0=9F=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/annotations.test.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/core/src/annotations.test.ts b/packages/core/src/annotations.test.ts index 1456a5fd2b..cdb9aa47ea 100644 --- a/packages/core/src/annotations.test.ts +++ b/packages/core/src/annotations.test.ts @@ -6,8 +6,12 @@ import { parseAnnotations, } from "./annotations" import assert from "assert/strict" +import { TestHost } from "./testhost" describe("annotations", () => { + beforeEach(() => { + TestHost.install() + }) test("github", () => { const output = ` ::error file=packages/core/src/github.ts,line=71,endLine=71,code=concatenation_override::The change on line 71 may lead to the original \`text\` content being overridden instead of appending the footer. Consider using \`text = appendGeneratedComment(script, info, text)\` to ensure the original text is preserved and the footer is appended. 😇 @@ -58,13 +62,4 @@ test("convertAnnotationsToItems", () => { ::warning file=src/greeter.ts,line=20,endLine=20,code=missing_semicolon::Missing semicolon after variable declaration. ` const output = convertAnnotationsToItems(input) - console.log(output) - assert.strictEqual( - output.trim(), - `- ⚠️ Missing semicolon after property declaration. ([src/greeter.ts#L2](src/greeter.ts) missing_semicolon) -- ⚠️ Missing semicolon after assignment. ([src/greeter.ts#L5](src/greeter.ts) missing_semicolon) -- ⚠️ Missing semicolon after return statement. ([src/greeter.ts#L9](src/greeter.ts) missing_semicolon) -- ⚠️ The function 'hello' is empty and should contain logic or be removed if not needed. ([src/greeter.ts#L18](src/greeter.ts) empty_function) -- ⚠️ Missing semicolon after variable declaration. ([src/greeter.ts#L20](src/greeter.ts) missing_semicolon)` - ) })