Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix backend tests to resolve the error ensure "done()" is called #131

Merged
merged 2 commits into from
May 26, 2024

Conversation

yacchin1205
Copy link
Contributor

The backend test of etherpad-lite was outputting the following error:

 1) export alignment to HTML
       when pad text is left aligned
         returns HTML with Subscript HTML tags:
     Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/work/etherpad-lite/etherpad-lite/node_modules/ep_align/static/tests/backend/specs/exportHTML.ts)
      at listOnTimeout (node:internal/timers:573:17)
      at process.processTimers (node:internal/timers:514:7)

The test (when pad text is left aligned - returns HTML with Subscript HTML tags) defined done as an argument even though it does not call done, and removing it seemed to resolve this error.
(The other returns HTML with Subscript HTML tags tests also do not define done as an argument.)

@yacchin1205 yacchin1205 marked this pull request as draft May 26, 2024 05:07
@yacchin1205
Copy link
Contributor Author

yacchin1205 commented May 26, 2024

I have found that the backend tests of ep_align with ep_headings2 shows the following error, and will attempt to resolve.

  1) export alignment to HTML
       when pad text is heading
         returns HTML with Subscript HTML tags:
     Error: No left tag detected
      at Test.<anonymous> (/home/ubuntu/etherpad-lite/node_modules/.pnpm/ep_align@0.3.94/node_modules/ep_align/static/tests/backend/specs/exportHTML.ts:175:30)
      at Test.assert (/home/ubuntu/etherpad-lite/node_modules/.pnpm/supertest@7.0.0/node_modules/supertest/lib/test.js:172:8)
      at localAssert (/home/ubuntu/etherpad-lite/node_modules/.pnpm/supertest@7.0.0/node_modules/supertest/lib/test.js:120:14)
      at /home/ubuntu/etherpad-lite/node_modules/.pnpm/supertest@7.0.0/node_modules/supertest/lib/test.js:125:7
      at callback (/home/ubuntu/etherpad-lite/node_modules/.pnpm/superagent@9.0.2/node_modules/superagent/src/node/index.js:887:12)
      at <anonymous> (/home/ubuntu/etherpad-lite/node_modules/.pnpm/superagent@9.0.2/node_modules/superagent/src/node/index.js:1165:18)
      at IncomingMessage.<anonymous> (/home/ubuntu/etherpad-lite/node_modules/.pnpm/superagent@9.0.2/node_modules/superagent/src/node/parsers/json.js:19:7)
      at IncomingMessage.emit (node:events:530:35)
      at IncomingMessage.emit (node:domain:488:12)
      at endReadableNT (node:internal/streams/readable:1696:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

@yacchin1205
Copy link
Contributor Author

Details of the No left tag detected error are as follows. I revised the expected pattern, as it looks functional.

Expected: <h1 style=\'text-align:left\'>Hello world</h1><br><br></body></html>
Actual: <h1 style=\'text-align:left\'>Hello world</h1><br><br></body></html>
(Actual has one more blank than Expected.)

@yacchin1205 yacchin1205 marked this pull request as ready for review May 26, 2024 06:04
@SamTV12345 SamTV12345 merged commit 3396d2a into ether:main May 26, 2024
2 checks passed
@SamTV12345
Copy link
Member

Thanks for the fix. Really appreciated. I took a look at the code forever and couldn't find the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants