Closed dominikzogg closed 3 months ago
I'm trying to reproduce it, but regular unit tests fail on my machine. See the failing test output below. I've commented-out the failing assertion and was able to run the tests.
Next, I made the change as StrykerJS does. The tests still succeed. This leads me to conclude that it is a valid surviving mutant. You're missing a test to verify that recursive
is correctly set.
diff --git a/src/multipart-middleware.ts b/src/multipart-middleware.ts
index 43c4c6f..c6e6a91 100644
--- a/src/multipart-middleware.ts
+++ b/src/multipart-middleware.ts
@@ -21,7 +21,7 @@ export const createMultipartMiddleware = (limits: busboy.Limits | undefined = un
const body = await new Promise<PassThrough>((resolve) => {
const temporaryPath = `${tmpdir()}/multipart/${randomBytes(64).toString('hex')}`;
- mkdirSync(temporaryPath, { recursive: true });
+ mkdirSync(temporaryPath);
const newBody = new PassThrough();
@nicojs on the CI the test does not fail: https://github.com/chubbyts/chubbyts-http-multipart/actions/runs/8034292527/job/21945721235 if i remove the mkdirSync(temporaryPath, { recursive: true });
it fails. It seems your running in another issue.
Ah, yes, I've taken another look. If you first run the tests once, then set { recursive: false }
and rerun them, you'll see that they will pass. This is a 'bug' in the test suite: they don't reset shared state before each test.
Also, since all tests share the same state, they cannot run concurrently, see https://stryker-mutator.io/docs/stryker-js/parallel-workers/
I've created a PR to fix these issues. If you have any more questions, feel free to let me know.
I see a false positive there. The first time the code get excuted the folder /tmp/multipart would not exist, on second run it does. Therefore it looks like removing
{ recursive: true }
wouldn't make a difference, but it does.chubbyts-http-multipart
Stryker config
Stryker environment
Test runner environment
Your Environment
Add stryker.log