@frontmcp/testing 1.4.1 → 1.5.0-rc.1

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.
@@ -2233,6 +2233,7 @@ var NotificationCollector = class {
2233
2233
  constructor(notifications) {
2234
2234
  this.notifications = notifications;
2235
2235
  }
2236
+ notifications;
2236
2237
  get received() {
2237
2238
  return [...this.notifications];
2238
2239
  }
@@ -2253,6 +2254,7 @@ var ProgressCollector = class {
2253
2254
  constructor(updates) {
2254
2255
  this.updates = updates;
2255
2256
  }
2257
+ updates;
2256
2258
  get all() {
2257
2259
  return [...this.updates];
2258
2260
  }
@@ -2288,6 +2290,7 @@ var ServerStartError = class extends TestClientError {
2288
2290
  this.name = "ServerStartError";
2289
2291
  Object.setPrototypeOf(this, new.target.prototype);
2290
2292
  }
2293
+ cause;
2291
2294
  };
2292
2295
 
2293
2296
  // libs/testing/src/server/port-registry.ts
@@ -3036,11 +3039,23 @@ async function createTestFixtures() {
3036
3039
  if (!tokenFactory) {
3037
3040
  throw new Error("Token factory not initialized");
3038
3041
  }
3039
- const clientInstance = await McpTestClient.create({
3042
+ const clientInstance = McpTestClient.create({
3040
3043
  baseUrl: serverInstance.info.baseUrl,
3041
3044
  transport: currentConfig.transport ?? "streamable-http",
3042
3045
  publicMode: currentConfig.publicMode
3043
- }).buildAndConnect();
3046
+ }).build();
3047
+ try {
3048
+ await clientInstance.connect();
3049
+ } catch (err) {
3050
+ const message = err instanceof Error ? err.message : String(err);
3051
+ if (/\b401\b|unauthor/i.test(message)) {
3052
+ console.warn(
3053
+ `[TestFixture] MCP client could not connect anonymously \u2014 the server requires authentication (${message}). Tests using only the 'server'/'auth' fixtures are unaffected; tests using the 'mcp' fixture must supply a token.`
3054
+ );
3055
+ } else {
3056
+ throw err;
3057
+ }
3058
+ }
3044
3059
  const auth = createAuthFixture(tokenFactory);
3045
3060
  const server = createServerFixture(serverInstance);
3046
3061
  return {
package/esm/index.mjs CHANGED
@@ -2122,6 +2122,7 @@ var NotificationCollector = class {
2122
2122
  constructor(notifications) {
2123
2123
  this.notifications = notifications;
2124
2124
  }
2125
+ notifications;
2125
2126
  get received() {
2126
2127
  return [...this.notifications];
2127
2128
  }
@@ -2142,6 +2143,7 @@ var ProgressCollector = class {
2142
2143
  constructor(updates) {
2143
2144
  this.updates = updates;
2144
2145
  }
2146
+ updates;
2145
2147
  get all() {
2146
2148
  return [...this.updates];
2147
2149
  }
@@ -3863,6 +3865,7 @@ var ConnectionError = class extends TestClientError {
3863
3865
  this.name = "ConnectionError";
3864
3866
  Object.setPrototypeOf(this, new.target.prototype);
3865
3867
  }
3868
+ cause;
3866
3869
  };
3867
3870
  var TimeoutError = class extends TestClientError {
3868
3871
  constructor(message, timeoutMs) {
@@ -3871,6 +3874,7 @@ var TimeoutError = class extends TestClientError {
3871
3874
  this.name = "TimeoutError";
3872
3875
  Object.setPrototypeOf(this, new.target.prototype);
3873
3876
  }
3877
+ timeoutMs;
3874
3878
  };
3875
3879
  var McpProtocolError = class extends TestClientError {
3876
3880
  constructor(message, code, data) {
@@ -3880,6 +3884,8 @@ var McpProtocolError = class extends TestClientError {
3880
3884
  this.name = "McpProtocolError";
3881
3885
  Object.setPrototypeOf(this, new.target.prototype);
3882
3886
  }
3887
+ code;
3888
+ data;
3883
3889
  };
3884
3890
  var ServerStartError = class extends TestClientError {
3885
3891
  constructor(message, cause) {
@@ -3888,6 +3894,7 @@ var ServerStartError = class extends TestClientError {
3888
3894
  this.name = "ServerStartError";
3889
3895
  Object.setPrototypeOf(this, new.target.prototype);
3890
3896
  }
3897
+ cause;
3891
3898
  };
3892
3899
  var AssertionError = class extends TestClientError {
3893
3900
  constructor(message) {
@@ -4816,11 +4823,23 @@ async function createTestFixtures() {
4816
4823
  if (!tokenFactory) {
4817
4824
  throw new Error("Token factory not initialized");
4818
4825
  }
4819
- const clientInstance = await McpTestClient.create({
4826
+ const clientInstance = McpTestClient.create({
4820
4827
  baseUrl: serverInstance.info.baseUrl,
4821
4828
  transport: currentConfig.transport ?? "streamable-http",
4822
4829
  publicMode: currentConfig.publicMode
4823
- }).buildAndConnect();
4830
+ }).build();
4831
+ try {
4832
+ await clientInstance.connect();
4833
+ } catch (err) {
4834
+ const message = err instanceof Error ? err.message : String(err);
4835
+ if (/\b401\b|unauthor/i.test(message)) {
4836
+ console.warn(
4837
+ `[TestFixture] MCP client could not connect anonymously \u2014 the server requires authentication (${message}). Tests using only the 'server'/'auth' fixtures are unaffected; tests using the 'mcp' fixture must supply a token.`
4838
+ );
4839
+ } else {
4840
+ throw err;
4841
+ }
4842
+ }
4824
4843
  const auth = createAuthFixture(tokenFactory);
4825
4844
  const server = createServerFixture(serverInstance);
4826
4845
  return {
@@ -6989,6 +7008,8 @@ var PerfFixturesImpl = class {
6989
7008
  this.collector = new MetricsCollector();
6990
7009
  this.leakDetector = new LeakDetector();
6991
7010
  }
7011
+ testName;
7012
+ project;
6992
7013
  collector;
6993
7014
  leakDetector;
6994
7015
  baselineSnapshot = null;
package/esm/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/testing",
3
- "version": "1.4.1",
3
+ "version": "1.5.0-rc.1",
4
4
  "description": "E2E testing framework for FrontMCP servers - MCP client, auth mocks, Playwright integration",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "homepage": "https://docs.agentfront.dev",
@@ -87,9 +87,9 @@
87
87
  "./esm": null
88
88
  },
89
89
  "peerDependencies": {
90
- "@frontmcp/lazy-zod": "1.4.1",
91
- "@frontmcp/sdk": "1.4.1",
92
- "@frontmcp/ui": "1.4.1",
90
+ "@frontmcp/lazy-zod": "1.5.0-rc.1",
91
+ "@frontmcp/sdk": "1.5.0-rc.1",
92
+ "@frontmcp/ui": "1.5.0-rc.1",
93
93
  "@jest/globals": "^29.0.0 || ^30.0.0",
94
94
  "@playwright/test": "^1.40.0",
95
95
  "jest": "^29.0.0 || ^30.0.0"
@@ -112,8 +112,8 @@
112
112
  "node": ">=24.0.0"
113
113
  },
114
114
  "dependencies": {
115
- "@frontmcp/protocol": "1.4.1",
116
- "@frontmcp/utils": "1.4.1",
115
+ "@frontmcp/protocol": "1.5.0-rc.1",
116
+ "@frontmcp/utils": "1.5.0-rc.1",
117
117
  "jose": "^6.0.11",
118
118
  "tslib": "^2.3.0"
119
119
  },
@@ -544,6 +544,8 @@ var PerfFixturesImpl = class {
544
544
  this.collector = new MetricsCollector();
545
545
  this.leakDetector = new LeakDetector();
546
546
  }
547
+ testName;
548
+ project;
547
549
  collector;
548
550
  leakDetector;
549
551
  baselineSnapshot = null;
@@ -2804,6 +2806,7 @@ var NotificationCollector = class {
2804
2806
  constructor(notifications) {
2805
2807
  this.notifications = notifications;
2806
2808
  }
2809
+ notifications;
2807
2810
  get received() {
2808
2811
  return [...this.notifications];
2809
2812
  }
@@ -2824,6 +2827,7 @@ var ProgressCollector = class {
2824
2827
  constructor(updates) {
2825
2828
  this.updates = updates;
2826
2829
  }
2830
+ updates;
2827
2831
  get all() {
2828
2832
  return [...this.updates];
2829
2833
  }
@@ -3043,6 +3047,7 @@ var ServerStartError = class extends TestClientError {
3043
3047
  this.name = "ServerStartError";
3044
3048
  Object.setPrototypeOf(this, new.target.prototype);
3045
3049
  }
3050
+ cause;
3046
3051
  };
3047
3052
 
3048
3053
  // libs/testing/src/server/port-registry.ts
package/esm/setup.mjs CHANGED
@@ -1,9 +1,18 @@
1
1
  var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __esm = (fn, res) => function __init() {
3
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
2
+ var __esm = (fn, res, err) => function __init() {
3
+ if (err) throw err[0];
4
+ try {
5
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
6
+ } catch (e) {
7
+ throw err = [e], e;
8
+ }
4
9
  };
5
10
  var __commonJS = (cb, mod) => function __require() {
6
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
+ try {
12
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
+ } catch (e) {
14
+ throw mod = 0, e;
15
+ }
7
16
  };
8
17
 
9
18
  // libs/testing/src/platform/platform-types.ts
package/fixtures/index.js CHANGED
@@ -2249,6 +2249,7 @@ var NotificationCollector = class {
2249
2249
  constructor(notifications) {
2250
2250
  this.notifications = notifications;
2251
2251
  }
2252
+ notifications;
2252
2253
  get received() {
2253
2254
  return [...this.notifications];
2254
2255
  }
@@ -2269,6 +2270,7 @@ var ProgressCollector = class {
2269
2270
  constructor(updates) {
2270
2271
  this.updates = updates;
2271
2272
  }
2273
+ updates;
2272
2274
  get all() {
2273
2275
  return [...this.updates];
2274
2276
  }
@@ -2304,6 +2306,7 @@ var ServerStartError = class extends TestClientError {
2304
2306
  this.name = "ServerStartError";
2305
2307
  Object.setPrototypeOf(this, new.target.prototype);
2306
2308
  }
2309
+ cause;
2307
2310
  };
2308
2311
 
2309
2312
  // libs/testing/src/server/port-registry.ts
@@ -3052,11 +3055,23 @@ async function createTestFixtures() {
3052
3055
  if (!tokenFactory) {
3053
3056
  throw new Error("Token factory not initialized");
3054
3057
  }
3055
- const clientInstance = await McpTestClient.create({
3058
+ const clientInstance = McpTestClient.create({
3056
3059
  baseUrl: serverInstance.info.baseUrl,
3057
3060
  transport: currentConfig.transport ?? "streamable-http",
3058
3061
  publicMode: currentConfig.publicMode
3059
- }).buildAndConnect();
3062
+ }).build();
3063
+ try {
3064
+ await clientInstance.connect();
3065
+ } catch (err) {
3066
+ const message = err instanceof Error ? err.message : String(err);
3067
+ if (/\b401\b|unauthor/i.test(message)) {
3068
+ console.warn(
3069
+ `[TestFixture] MCP client could not connect anonymously \u2014 the server requires authentication (${message}). Tests using only the 'server'/'auth' fixtures are unaffected; tests using the 'mcp' fixture must supply a token.`
3070
+ );
3071
+ } else {
3072
+ throw err;
3073
+ }
3074
+ }
3060
3075
  const auth = createAuthFixture(tokenFactory);
3061
3076
  const server = createServerFixture(serverInstance);
3062
3077
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"test-fixture.d.ts","sourceRoot":"","sources":["../../src/fixtures/test-fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAeH,OAAO,KAAK,EAIV,YAAY,EAGZ,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AA+BzB;;GAEG;AACH,iBAAe,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CA6DxD;AAED;;GAEG;AACH,iBAAe,kBAAkB,IAAI,OAAO,CAAC,YAAY,CAAC,CA6BzD;AAED;;;;GAIG;AACH,iBAAe,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB5F;AAED;;GAEG;AACH,iBAAe,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQrD;AAmMD,QAAA,MAAM,IAAI,EAAuB,gBAAgB,CAAC;AAqBlD,OAAO,EAAE,IAAI,EAAE,CAAC;AAGhB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,CAAC"}
1
+ {"version":3,"file":"test-fixture.d.ts","sourceRoot":"","sources":["../../src/fixtures/test-fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAeH,OAAO,KAAK,EAIV,YAAY,EAGZ,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AA+BzB;;GAEG;AACH,iBAAe,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CA6DxD;AAED;;GAEG;AACH,iBAAe,kBAAkB,IAAI,OAAO,CAAC,YAAY,CAAC,CAkDzD;AAED;;;;GAIG;AACH,iBAAe,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB5F;AAED;;GAEG;AACH,iBAAe,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQrD;AAmMD,QAAA,MAAM,IAAI,EAAuB,gBAAgB,CAAC;AAqBlD,OAAO,EAAE,IAAI,EAAE,CAAC;AAGhB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,CAAC"}
package/index.js CHANGED
@@ -2241,6 +2241,7 @@ var NotificationCollector = class {
2241
2241
  constructor(notifications) {
2242
2242
  this.notifications = notifications;
2243
2243
  }
2244
+ notifications;
2244
2245
  get received() {
2245
2246
  return [...this.notifications];
2246
2247
  }
@@ -2261,6 +2262,7 @@ var ProgressCollector = class {
2261
2262
  constructor(updates) {
2262
2263
  this.updates = updates;
2263
2264
  }
2265
+ updates;
2264
2266
  get all() {
2265
2267
  return [...this.updates];
2266
2268
  }
@@ -3982,6 +3984,7 @@ var ConnectionError = class extends TestClientError {
3982
3984
  this.name = "ConnectionError";
3983
3985
  Object.setPrototypeOf(this, new.target.prototype);
3984
3986
  }
3987
+ cause;
3985
3988
  };
3986
3989
  var TimeoutError = class extends TestClientError {
3987
3990
  constructor(message, timeoutMs) {
@@ -3990,6 +3993,7 @@ var TimeoutError = class extends TestClientError {
3990
3993
  this.name = "TimeoutError";
3991
3994
  Object.setPrototypeOf(this, new.target.prototype);
3992
3995
  }
3996
+ timeoutMs;
3993
3997
  };
3994
3998
  var McpProtocolError = class extends TestClientError {
3995
3999
  constructor(message, code, data) {
@@ -3999,6 +4003,8 @@ var McpProtocolError = class extends TestClientError {
3999
4003
  this.name = "McpProtocolError";
4000
4004
  Object.setPrototypeOf(this, new.target.prototype);
4001
4005
  }
4006
+ code;
4007
+ data;
4002
4008
  };
4003
4009
  var ServerStartError = class extends TestClientError {
4004
4010
  constructor(message, cause) {
@@ -4007,6 +4013,7 @@ var ServerStartError = class extends TestClientError {
4007
4013
  this.name = "ServerStartError";
4008
4014
  Object.setPrototypeOf(this, new.target.prototype);
4009
4015
  }
4016
+ cause;
4010
4017
  };
4011
4018
  var AssertionError = class extends TestClientError {
4012
4019
  constructor(message) {
@@ -4928,11 +4935,23 @@ async function createTestFixtures() {
4928
4935
  if (!tokenFactory) {
4929
4936
  throw new Error("Token factory not initialized");
4930
4937
  }
4931
- const clientInstance = await McpTestClient.create({
4938
+ const clientInstance = McpTestClient.create({
4932
4939
  baseUrl: serverInstance.info.baseUrl,
4933
4940
  transport: currentConfig.transport ?? "streamable-http",
4934
4941
  publicMode: currentConfig.publicMode
4935
- }).buildAndConnect();
4942
+ }).build();
4943
+ try {
4944
+ await clientInstance.connect();
4945
+ } catch (err) {
4946
+ const message = err instanceof Error ? err.message : String(err);
4947
+ if (/\b401\b|unauthor/i.test(message)) {
4948
+ console.warn(
4949
+ `[TestFixture] MCP client could not connect anonymously \u2014 the server requires authentication (${message}). Tests using only the 'server'/'auth' fixtures are unaffected; tests using the 'mcp' fixture must supply a token.`
4950
+ );
4951
+ } else {
4952
+ throw err;
4953
+ }
4954
+ }
4936
4955
  const auth = createAuthFixture(tokenFactory);
4937
4956
  const server = createServerFixture(serverInstance);
4938
4957
  return {
@@ -7101,6 +7120,8 @@ var PerfFixturesImpl = class {
7101
7120
  this.collector = new MetricsCollector();
7102
7121
  this.leakDetector = new LeakDetector();
7103
7122
  }
7123
+ testName;
7124
+ project;
7104
7125
  collector;
7105
7126
  leakDetector;
7106
7127
  baselineSnapshot = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/testing",
3
- "version": "1.4.1",
3
+ "version": "1.5.0-rc.1",
4
4
  "description": "E2E testing framework for FrontMCP servers - MCP client, auth mocks, Playwright integration",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "homepage": "https://docs.agentfront.dev",
@@ -87,9 +87,9 @@
87
87
  "./esm": null
88
88
  },
89
89
  "peerDependencies": {
90
- "@frontmcp/lazy-zod": "1.4.1",
91
- "@frontmcp/sdk": "1.4.1",
92
- "@frontmcp/ui": "1.4.1",
90
+ "@frontmcp/lazy-zod": "1.5.0-rc.1",
91
+ "@frontmcp/sdk": "1.5.0-rc.1",
92
+ "@frontmcp/ui": "1.5.0-rc.1",
93
93
  "@jest/globals": "^29.0.0 || ^30.0.0",
94
94
  "@playwright/test": "^1.40.0",
95
95
  "jest": "^29.0.0 || ^30.0.0"
@@ -112,8 +112,8 @@
112
112
  "node": ">=24.0.0"
113
113
  },
114
114
  "dependencies": {
115
- "@frontmcp/protocol": "1.4.1",
116
- "@frontmcp/utils": "1.4.1",
115
+ "@frontmcp/protocol": "1.5.0-rc.1",
116
+ "@frontmcp/utils": "1.5.0-rc.1",
117
117
  "jose": "^6.0.11",
118
118
  "tslib": "^2.3.0"
119
119
  },
package/perf/index.js CHANGED
@@ -606,6 +606,8 @@ var PerfFixturesImpl = class {
606
606
  this.collector = new MetricsCollector();
607
607
  this.leakDetector = new LeakDetector();
608
608
  }
609
+ testName;
610
+ project;
609
611
  collector;
610
612
  leakDetector;
611
613
  baselineSnapshot = null;
@@ -2866,6 +2868,7 @@ var NotificationCollector = class {
2866
2868
  constructor(notifications) {
2867
2869
  this.notifications = notifications;
2868
2870
  }
2871
+ notifications;
2869
2872
  get received() {
2870
2873
  return [...this.notifications];
2871
2874
  }
@@ -2886,6 +2889,7 @@ var ProgressCollector = class {
2886
2889
  constructor(updates) {
2887
2890
  this.updates = updates;
2888
2891
  }
2892
+ updates;
2889
2893
  get all() {
2890
2894
  return [...this.updates];
2891
2895
  }
@@ -3105,6 +3109,7 @@ var ServerStartError = class extends TestClientError {
3105
3109
  this.name = "ServerStartError";
3106
3110
  Object.setPrototypeOf(this, new.target.prototype);
3107
3111
  }
3112
+ cause;
3108
3113
  };
3109
3114
 
3110
3115
  // libs/testing/src/server/port-registry.ts