mock-mcp 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
|
+
import { realpathSync } from "node:fs";
|
|
3
4
|
import process from "node:process";
|
|
4
5
|
import { TestMockMCPServer, } from "./server/test-mock-mcp-server.js";
|
|
5
6
|
import { BatchMockCollector, } from "./client/batch-mock-collector.js";
|
|
@@ -40,7 +41,11 @@ const isCliExecution = (() => {
|
|
|
40
41
|
if (typeof process === "undefined" || !process.argv?.[1]) {
|
|
41
42
|
return false;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
// Resolve symlinks to ensure proper comparison between import.meta.url and argv[1]
|
|
45
|
+
// This is necessary because import.meta.url contains the real path,
|
|
46
|
+
// while process.argv[1] may contain symlinks (e.g., /tmp vs /private/tmp on macOS)
|
|
47
|
+
const scriptPath = realpathSync(process.argv[1]);
|
|
48
|
+
return import.meta.url === pathToFileURL(scriptPath).href;
|
|
44
49
|
})();
|
|
45
50
|
if (isCliExecution) {
|
|
46
51
|
runCli().catch((error) => {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mock-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "An MCP server enabling LLMs to write integration tests through live test environment interaction",
|
|
5
5
|
"main": "./dist/connect.cjs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"mock-mcp": "dist/index.js"
|
|
8
|
+
"mock-mcp": "./dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|