Skip to content

Commit 62e80a0

Browse files
committed
fix: resolve Jest ES module compatibility issues
🔧 Jest Configuration Updates: - Rename jest.config.js to jest.config.cjs (CommonJS format) - Rename jest.config.ci.js to jest.config.ci.cjs (CommonJS format) - Update package.json scripts to reference .cjs files 🎯 Root Cause: Adding 'type': 'module' to package.json for Smithery compatibility caused Jest config files to be treated as ES modules, but Jest expects CommonJS configuration files. ✅ Results: - npm run test:ci: ✅ 31 tests pass (CI-safe core functionality) - npm test: ⚠️ 62 pass, 16 fail (includes expected mock error tests) - Maintains proper test separation for CI vs development environments This resolves the ReferenceError: module is not defined in ES module scope error that was preventing CI tests from running.
1 parent 4b55b3f commit 62e80a0

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed
File renamed without changes.
File renamed without changes.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"test:coverage": "jest --coverage",
2424
"test:integration": "jest --testPathPattern=integration",
2525
"test:unit": "jest --testPathPattern=unit",
26-
"test:ci": "jest --config=jest.config.ci.js",
27-
"test:ci:coverage": "jest --config=jest.config.ci.js --coverage",
26+
"test:ci": "jest --config=jest.config.ci.cjs",
27+
"test:ci:coverage": "jest --config=jest.config.ci.cjs --coverage",
2828
"test:core": "jest --testPathIgnorePatterns='credentials.test.ts|tags.test.ts|newWorkflowTools.test.ts'",
2929
"test:mock-errors": "jest --testPathPattern='credentials.test.ts|tags.test.ts|newWorkflowTools.test.ts'"
3030
},

test-results/junit.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<testsuites name="n8n-workflow-builder CI Tests" tests="31" failures="0" errors="0" time="2.053">
3-
<testsuite name="Execution Management Integration Tests" errors="0" failures="0" skipped="0" timestamp="2025-07-25T18:10:59" time="1.392" tests="10">
4-
<testcase classname="Execution Management Integration Tests list_executions should list all executions successfully" name="Execution Management Integration Tests list_executions should list all executions successfully" time="0.007">
2+
<testsuites name="n8n-workflow-builder CI Tests" tests="31" failures="0" errors="0" time="3.646">
3+
<testsuite name="Execution Management Integration Tests" errors="0" failures="0" skipped="0" timestamp="2025-07-27T19:59:12" time="2.757" tests="10">
4+
<testcase classname="Execution Management Integration Tests list_executions should list all executions successfully" name="Execution Management Integration Tests list_executions should list all executions successfully" time="0.008">
55
</testcase>
66
<testcase classname="Execution Management Integration Tests list_executions should support filtering by workflow ID" name="Execution Management Integration Tests list_executions should support filtering by workflow ID" time="0.001">
77
</testcase>
@@ -22,8 +22,8 @@
2222
<testcase classname="Execution Management Integration Tests delete_execution should require execution ID" name="Execution Management Integration Tests delete_execution should require execution ID" time="0">
2323
</testcase>
2424
</testsuite>
25-
<testsuite name="MCP Resources Integration Tests" errors="0" failures="0" skipped="0" timestamp="2025-07-25T18:10:59" time="1.422" tests="8">
26-
<testcase classname="MCP Resources Integration Tests Resource Templates should list available resource templates" name="MCP Resources Integration Tests Resource Templates should list available resource templates" time="0.007">
25+
<testsuite name="MCP Resources Integration Tests" errors="0" failures="0" skipped="0" timestamp="2025-07-27T19:59:12" time="2.774" tests="8">
26+
<testcase classname="MCP Resources Integration Tests Resource Templates should list available resource templates" name="MCP Resources Integration Tests Resource Templates should list available resource templates" time="0.008">
2727
</testcase>
2828
<testcase classname="MCP Resources Integration Tests Static Resources should read /workflows resource" name="MCP Resources Integration Tests Static Resources should read /workflows resource" time="0.001">
2929
</testcase>
@@ -35,35 +35,35 @@
3535
</testcase>
3636
<testcase classname="MCP Resources Integration Tests Dynamic Resources should read execution by ID resource" name="MCP Resources Integration Tests Dynamic Resources should read execution by ID resource" time="0">
3737
</testcase>
38-
<testcase classname="MCP Resources Integration Tests Dynamic Resources should handle not found resources" name="MCP Resources Integration Tests Dynamic Resources should handle not found resources" time="0.029">
38+
<testcase classname="MCP Resources Integration Tests Dynamic Resources should handle not found resources" name="MCP Resources Integration Tests Dynamic Resources should handle not found resources" time="0.018">
3939
</testcase>
40-
<testcase classname="MCP Resources Integration Tests Resource Listing should list all available resources" name="MCP Resources Integration Tests Resource Listing should list all available resources" time="0.001">
40+
<testcase classname="MCP Resources Integration Tests Resource Listing should list all available resources" name="MCP Resources Integration Tests Resource Listing should list all available resources" time="0">
4141
</testcase>
4242
</testsuite>
43-
<testsuite name="End-to-End Workflow Tests" errors="0" failures="0" skipped="0" timestamp="2025-07-25T18:11:00" time="0.211" tests="2">
43+
<testsuite name="End-to-End Workflow Tests" errors="0" failures="0" skipped="0" timestamp="2025-07-27T19:59:15" time="0.179" tests="2">
4444
<testcase classname="End-to-End Workflow Tests should complete full workflow lifecycle: create → activate → list → get → deactivate → delete" name="End-to-End Workflow Tests should complete full workflow lifecycle: create → activate → list → get → deactivate → delete" time="0.001">
4545
</testcase>
46-
<testcase classname="End-to-End Workflow Tests should handle workflow execution flow" name="End-to-End Workflow Tests should handle workflow execution flow" time="0.005">
46+
<testcase classname="End-to-End Workflow Tests should handle workflow execution flow" name="End-to-End Workflow Tests should handle workflow execution flow" time="0.002">
4747
</testcase>
4848
</testsuite>
49-
<testsuite name="Error Handling Integration Tests" errors="0" failures="0" skipped="0" timestamp="2025-07-25T18:11:00" time="0.221" tests="11">
49+
<testsuite name="Error Handling Integration Tests" errors="0" failures="0" skipped="0" timestamp="2025-07-27T19:59:15" time="0.197" tests="11">
5050
<testcase classname="Error Handling Integration Tests Network and API Errors should handle network connection errors" name="Error Handling Integration Tests Network and API Errors should handle network connection errors" time="0.001">
5151
</testcase>
5252
<testcase classname="Error Handling Integration Tests Network and API Errors should handle n8n API authentication errors" name="Error Handling Integration Tests Network and API Errors should handle n8n API authentication errors" time="0">
5353
</testcase>
5454
<testcase classname="Error Handling Integration Tests Network and API Errors should handle n8n API rate limiting" name="Error Handling Integration Tests Network and API Errors should handle n8n API rate limiting" time="0">
5555
</testcase>
56-
<testcase classname="Error Handling Integration Tests Network and API Errors should handle n8n server errors" name="Error Handling Integration Tests Network and API Errors should handle n8n server errors" time="0">
56+
<testcase classname="Error Handling Integration Tests Network and API Errors should handle n8n server errors" name="Error Handling Integration Tests Network and API Errors should handle n8n server errors" time="0.001">
5757
</testcase>
58-
<testcase classname="Error Handling Integration Tests Invalid Parameters should validate missing required parameters" name="Error Handling Integration Tests Invalid Parameters should validate missing required parameters" time="0">
58+
<testcase classname="Error Handling Integration Tests Invalid Parameters should validate missing required parameters" name="Error Handling Integration Tests Invalid Parameters should validate missing required parameters" time="0.001">
5959
</testcase>
60-
<testcase classname="Error Handling Integration Tests Invalid Parameters should validate invalid workflow data structure" name="Error Handling Integration Tests Invalid Parameters should validate invalid workflow data structure" time="0.001">
60+
<testcase classname="Error Handling Integration Tests Invalid Parameters should validate invalid workflow data structure" name="Error Handling Integration Tests Invalid Parameters should validate invalid workflow data structure" time="0">
6161
</testcase>
62-
<testcase classname="Error Handling Integration Tests Invalid Parameters should handle invalid execution filters" name="Error Handling Integration Tests Invalid Parameters should handle invalid execution filters" time="0">
62+
<testcase classname="Error Handling Integration Tests Invalid Parameters should handle invalid execution filters" name="Error Handling Integration Tests Invalid Parameters should handle invalid execution filters" time="0.001">
6363
</testcase>
64-
<testcase classname="Error Handling Integration Tests Resource Access Errors should handle invalid resource URIs" name="Error Handling Integration Tests Resource Access Errors should handle invalid resource URIs" time="0.012">
64+
<testcase classname="Error Handling Integration Tests Resource Access Errors should handle invalid resource URIs" name="Error Handling Integration Tests Resource Access Errors should handle invalid resource URIs" time="0.011">
6565
</testcase>
66-
<testcase classname="Error Handling Integration Tests Resource Access Errors should handle resource not found errors" name="Error Handling Integration Tests Resource Access Errors should handle resource not found errors" time="0.001">
66+
<testcase classname="Error Handling Integration Tests Resource Access Errors should handle resource not found errors" name="Error Handling Integration Tests Resource Access Errors should handle resource not found errors" time="0">
6767
</testcase>
6868
<testcase classname="Error Handling Integration Tests Tool Not Found should handle calls to non-existent tools" name="Error Handling Integration Tests Tool Not Found should handle calls to non-existent tools" time="0">
6969
</testcase>

0 commit comments

Comments
 (0)