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

compat: tracking issue for running mocha test case #12886

Closed
21 of 27 tasks
kt3k opened this issue Nov 24, 2021 · 9 comments
Closed
21 of 27 tasks

compat: tracking issue for running mocha test case #12886

kt3k opened this issue Nov 24, 2021 · 9 comments
Assignees
Labels
feat new feature (which has been agreed to/accepted) node compat

Comments

@kt3k
Copy link
Member

kt3k commented Nov 24, 2021

This issue tracks the progress of running the test cases of mocha repository.

test.node category

lint category

  • npx nps lint.markdown doesn't work. Mocha depends on an ancient version of markdownlint-cli which depends on an ancient version of Commander which uses __proto__ in inheritance ref: https://github.com/tj/commander.js/blob/v2.3.0/index.js#L94
    • I sent upstream an PR which updates the markdownlint-cli as it's a very old version, and doesn't seem worth support it in node-compat mode (mocha # 4795) Update: PR rejected but the maintainer addressed the issue in another PR
  • npx nps lint.code hangs without information. Needs more investigation

Other issus

(These issues need further works to identify what exactly causes them)

  • TypeError: Invalid signal: SIGBREAK
  • Cannot find module 'https'
  • mocha depends on fs-extra, which depends on fs.realpath.native

Known issues which block this task:

ref: #12577

@bartlomieju
Copy link
Member

run nps (task runner used in the repo) blocked by std-1633

@kt3k there's no 1633 in deno_std, did you mean 1622 (setTimeout/setInterval)?

@kt3k
Copy link
Member Author

kt3k commented Nov 25, 2021

@bartlomieju Oh, it was 1630. The tool nps stops on the error about process.binding('wrap_tty').TTY

$ deno run --compat --unstable -A node_modules/.bin/nps
error: Uncaught (in promise) TypeError: process.binding is not a function
  TTY = process.binding('tty_wrap').TTY,
                ^
    at Object.<anonymous> (file:///Users/kt3k/oss/mocha/node_modules/readline-sync/lib/readline-sync.js:19:17)

@kt3k kt3k changed the title compat: tacking issue for running mocha test case compat: tracking issue for running mocha test case Nov 30, 2021
@kt3k
Copy link
Member Author

kt3k commented Mar 17, 2022

#13553 resolved many issues in mocha compatibility!

@kt3k
Copy link
Member Author

kt3k commented Mar 17, 2022

Here https://github.com/mochajs/mocha/blob/d7f6ea5f5d8406204053618c708634dbf5aa9670/lib/nodejs/parallel-buffered-runner.js#L14, mocha shadows setInterval in wrapper function scope with global one. It disables our providing-timers-in-wrapper-function hack 😬

@kt3k
Copy link
Member Author

kt3k commented Mar 17, 2022

Maybe we can fake global object using Proxy 🤔

@stale
Copy link

stale bot commented May 31, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 31, 2022
@kt3k kt3k removed the stale label May 31, 2022
@stale
Copy link

stale bot commented Jul 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 30, 2022
@kitsonk kitsonk added the feat new feature (which has been agreed to/accepted) label Jul 30, 2022
@kt3k kt3k removed the stale label Jul 31, 2022
@kt3k
Copy link
Member Author

kt3k commented May 11, 2023

I was testing this with the alias node="deno run --compat --unstable", but now the commonjs entrypoint is not supported. So mocha's test case can't be run with the current compat behavior of Deno.

@kt3k
Copy link
Member Author

kt3k commented Sep 18, 2024

The major cases like the below seem passing now. Closing as fixed:

deno task test-node:unit
deno task test-node:jsapi
deno task test-node:reporters

@kt3k kt3k closed this as completed Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat new feature (which has been agreed to/accepted) node compat
Projects
None yet
Development

No branches or pull requests

3 participants