| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d039e6f commit b569105
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -945,13 +945,18 @@ The realpath of the testing temporary directory. | |||
| 945 | 945 | ||
| 946 | 946 | Deletes and recreates the testing temporary directory. | |
| 947 | 947 | ||
| 948 | - The first time `refresh()` runs, it adds a listener to process `'exit'` that | ||
| 948 | + The first time `refresh()` runs, it adds a listener to process `'exit'` that | ||
| 949 | 949 | cleans the temporary directory. Thus, every file under `tmpdir.path` needs to | |
| 950 | 950 | be closed before the test completes. A good way to do this is to add a | |
| 951 | 951 | listener to process `'beforeExit'`. If a file needs to be left open until | |
| 952 | 952 | Node.js completes, use a child process and call `refresh()` only in the | |
| 953 | 953 | parent. | |
| 954 | 954 | ||
| 955 | + It is usually only necessary to call `refresh()` once in a test file. | ||
| 956 | + Avoid calling it more than once in an asynchronous context as one call | ||
| 957 | + might refresh the temporary directory of a different context, causing | ||
| 958 | + the test to fail somewhat mysteriously. | ||
| 959 | + | ||
| 955 | 960 | ## UDP pair helper | |
| 956 | 961 | ||
| 957 | 962 | The `common/udppair` module exports a function `makeUDPPair` and a class | |
| Back | FazBrowse Home | New Git URL |
0 commit comments