| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d5cc5d7 commit c1a8ae3
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,8 +48,14 @@ describe('Worker threads do not spawn infinitely', { concurrency: true }, () => | |||
| 48 | 48 | ]); | |
| 49 | 49 | ||
| 50 | 50 | assert.strictEqual(stderr, ''); | |
| 51 | + // We are validating that: | ||
| 52 | + // 1. the `--require` flag is run first from the main thread (and A is printed). | ||
| 53 | + // 2. the `--require` flag is then run on the loader thread (and A is printed). | ||
| 54 | + // 3. the `--loader` module is executed (and B is printed). | ||
| 55 | + // 4. the `--import` module is evaluated once, on the main thread (and C is printed). | ||
| 56 | + // 5. the user code is finally executed (and D is printed). | ||
| 51 | 57 | // The worker code should always run before the --import, but the console.log might arrive late. | |
| 52 | - assert.match(stdout, /^A\r?\nA\r?\n(B\r?\nC|C\r?\nB)\r?\nD\r?\n$/); | ||
| 58 | + assert.match(stdout, /^A\r?\n(A\r?\nB\r?\nC|A\r?\nC\r?\nB|C\r?\nA\r?\nB)\r?\nD\r?\n$/); | ||
| 53 | 59 | assert.strictEqual(code, 0); | |
| 54 | 60 | assert.strictEqual(signal, null); | |
| 55 | 61 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments