chore: update module test for full check#7510
Merged
jasonsaayman merged 7 commits intov1.xfrom Mar 15, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
7 issues found across 18 files
Confidence score: 2/5
- Merge risk is high because several medium-severity, high-confidence issues are concrete failures:
package.jsonreferences a missing child script, sonpm run test:smoke:cjs:vitestwill fail immediately. - Multiple assertions in
tests/smoke/esm/tests/import.smoke.test.jscomparetypeofstrings to constructors (AxiosHeaders,AxiosError,CanceledError), which can cause smoke tests to fail even when exports are correct. - Test portability is also at risk: cleanup in
tests/module/cjs/tests/helpers/fixture.cjsandtests/module/esm/tests/helpers/fixture.jsrelies on Unixrm/rm -rf, andtests/module/esm/tests/ts.module.test.jsuses a fixture setup that may not resolveaxios/Node typings before the interop check runs. - Pay close attention to
package.json,tests/smoke/esm/tests/import.smoke.test.js,tests/module/cjs/tests/helpers/fixture.cjs,tests/module/esm/tests/helpers/fixture.js,tests/module/esm/tests/ts.module.test.js- these are the most likely sources of immediate CI/test breakage and cross-platform failures.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/module/cjs/tests/helpers/fixture.cjs">
<violation number="1" location="tests/module/cjs/tests/helpers/fixture.cjs:20">
P2: Use Node's filesystem API for cleanup instead of invoking the Unix-only `rm` command, or these tests will fail on non-POSIX environments.</violation>
</file>
<file name="package.json">
<violation number="1" location="package.json:57">
P2: This command points to a child script that does not exist, so `npm run test:smoke:cjs:vitest` will fail immediately.</violation>
</file>
<file name="tests/module/esm/tests/helpers/fixture.js">
<violation number="1" location="tests/module/esm/tests/helpers/fixture.js:20">
P2: Avoid shelling out to `rm -rf` for fixture cleanup. `runCommand()` invokes the executable directly, so environments without a Unix `rm` binary will fail these tests in the `finally` cleanup path.</violation>
</file>
<file name="tests/smoke/esm/tests/import.smoke.test.js">
<violation number="1" location="tests/smoke/esm/tests/import.smoke.test.js:27">
P2: This assertion compares a `typeof` string to the constructor, so the smoke test will fail even when `axios.CanceledError` is exported correctly.</violation>
<violation number="2" location="tests/smoke/esm/tests/import.smoke.test.js:31">
P2: This assertion compares a `typeof` result to `AxiosError`, which makes the test fail for a valid export.</violation>
<violation number="3" location="tests/smoke/esm/tests/import.smoke.test.js:35">
P2: This assertion uses `typeof` on `axios.AxiosHeaders`, so it compares `'function'` to the constructor instead of checking export equality.</violation>
</file>
<file name="tests/module/esm/tests/ts.module.test.js">
<violation number="1" location="tests/module/esm/tests/ts.module.test.js:25">
P2: This temp fixture does not provide a resolvable `axios` package (or Node typings), so the new test will fail before it can verify TS import interop.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
There was a problem hiding this comment.
2 issues found across 5 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/module/cjs/tests/helpers/fixture.cjs">
<violation number="1" location="tests/module/cjs/tests/helpers/fixture.cjs:19">
P1: `fs.rmSync` breaks the CJS module tests on the Node 12 matrix because that API was only added in later Node releases.</violation>
</file>
<file name="tests/module/esm/tests/helpers/fixture.js">
<violation number="1" location="tests/module/esm/tests/helpers/fixture.js:19">
P2: `fs.rmSync` is not available on the Node 12 CI target, so this cleanup helper will crash there. Use a Node-12-compatible fallback when `fs.rmSync` is missing.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Adds ESM and CJS module test suites and smoke tests, wires them into CI across Node 12–18, fixes the CJS smoke import, and raises CJS test timeouts for CI stability. Also verifies the ESM deep import of
axios/unsafe/core/settle.js.Description
mocha(10s timeout), ESM withvitest(60s timeout).axios/unsafe/core/settle.js.require('axios')and pass consistently.rmSyncfallback) and command execution with clearer errors.test:smoke:cjs:vitest,test:smoke:esm:vitest,test:module:cjs,test:module:esm.cjs-module-testsjob (Node 12, 14, 16, 18) in.github/workflows/run-ci.yml, uses npm cache fortests/module/cjs/package-lock.json, downloadsaxios-tarball, and depends onbuild-and-run-vitest.Testing
require('axios')andrequire('axios').default; smoke tests assert named exports;mochatimeout set to 10s.import axios; smoke tests validate deep importaxios/unsafe/core/settle.js;vitesttestTimeout set to 60s.rm.Written for commit db732f2. Summary will update on new commits.