Skip to content

Open handle issue when testing configured express application #39

@christopher-watanabe-snkeos

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions