From 281c489755b7d6280236938176f0fc29c190b066 Mon Sep 17 00:00:00 2001 From: yacchin1205 <968739+yacchin1205@users.noreply.github.com> Date: Sun, 26 May 2024 10:50:32 +0900 Subject: [PATCH 1/2] Fix backend tests to resolve the error `For async tests and hooks, ensure "done()" is called` --- static/tests/backend/specs/exportHTML.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/tests/backend/specs/exportHTML.ts b/static/tests/backend/specs/exportHTML.ts index dbba2d7..f46c7b8 100644 --- a/static/tests/backend/specs/exportHTML.ts +++ b/static/tests/backend/specs/exportHTML.ts @@ -136,7 +136,7 @@ describe('export alignment to HTML', function () { .expect(200); }); - it('returns HTML with Subscript HTML tags', async function (done) { + it('returns HTML with Subscript HTML tags', async function () { const res = await agent.get(getHTMLEndPointFor(padID)) .set("Authorization", await generateJWTToken()) const html = res.body.data.html; From 224bd062c27f0b528e6e9ef1c44de18ef1c201aa Mon Sep 17 00:00:00 2001 From: yacchin1205 <968739+yacchin1205@users.noreply.github.com> Date: Sun, 26 May 2024 14:59:13 +0900 Subject: [PATCH 2/2] Fix backend tests to resolve the error `No left tag detected` --- static/tests/backend/specs/exportHTML.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/tests/backend/specs/exportHTML.ts b/static/tests/backend/specs/exportHTML.ts index f46c7b8..ec0ab46 100644 --- a/static/tests/backend/specs/exportHTML.ts +++ b/static/tests/backend/specs/exportHTML.ts @@ -170,8 +170,8 @@ describe('export alignment to HTML', function () { reject(err); } else { const html = res.body.data.html; - const expectedHTML = '

Hello world



'; - if (html.indexOf(expectedHTML) === -1) { + const expectedHTML = /

Hello world<\/h1>

<\/body><\/html>/; + if (html.search(expectedHTML) === -1) { reject(new Error('No left tag detected')); } else { resolve();