GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: clarify usage of tmpdir.refresh() · nodejs/node@776ef11

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/common
    • README.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/common/README.md‎

Copy file name to clipboardExpand all lines: test/common/README.md
+6-1Lines changed: 6 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -944,13 +944,18 @@ The realpath of the testing temporary directory.
944944

945945
Deletes and recreates the testing temporary directory.
946946

947-
The first time `refresh()` runs, it adds a listener to process `'exit'` that
947+
The first time `refresh()` runs, it adds a listener to process `'exit'` that
948948
cleans the temporary directory. Thus, every file under `tmpdir.path` needs to
949949
be closed before the test completes. A good way to do this is to add a
950950
listener to process `'beforeExit'`. If a file needs to be left open until
951951
Node.js completes, use a child process and call `refresh()` only in the
952952
parent.
953953

954+
It is usually only necessary to call `refresh()` once in a test file.
955+
Avoid calling it more than once in an asynchronous context as one call
956+
might refresh the temporary directory of a different context, causing
957+
the test to fail somewhat mysteriously.
958+
954959
## UDP pair helper
955960

956961
The `common/udppair` module exports a function `makeUDPPair` and a class

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.