File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -944,13 +944,18 @@ The realpath of the testing temporary directory.
944
944
945
945
Deletes and recreates the testing temporary directory.
946
946
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
948
948
cleans the temporary directory. Thus, every file under ` tmpdir.path ` needs to
949
949
be closed before the test completes. A good way to do this is to add a
950
950
listener to process ` 'beforeExit' ` . If a file needs to be left open until
951
951
Node.js completes, use a child process and call ` refresh() ` only in the
952
952
parent.
953
953
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
+
954
959
## UDP pair helper
955
960
956
961
The ` common/udppair ` module exports a function ` makeUDPPair ` and a class
You can’t perform that action at this time.
0 commit comments