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

Open handle issue when testing configured express application #39

Open
christopher-watanabe-snkeos opened this issue Dec 8, 2023 · 0 comments

Comments

@christopher-watanabe-snkeos
Copy link

christopher-watanabe-snkeos commented Dec 8, 2023

I configure my express application as laid out in the README using i18n-express 1.1.3 and the application starts without a problem.

However, when I test my application using Jest, I receive the following error:

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

● FSEVENTWRAP

  23 |
  24 |   app.use(
> 25 |     i18n({
     |     ^

Looks like the constructor activates a file system watch on the translationsPath directory, which I think doesn't get closed in the scope of my tests. It looks like there's an option to allow closing the watcher with an abort signal https://nodejs.org/docs/latest-v18.x/api/fs.html#fswatchfilename-options-listener, but the option isn't set in the call to fs.watch.

In the meantime, since I know roughly where the issue originates, I can --forceExit my jest tests in the meantime.

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

No branches or pull requests

1 participant