@nestjs/testing 12.0.3 → 12.1.0

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/Readme.md CHANGED
@@ -47,6 +47,10 @@ For questions and support please use the official [Discord channel](https://disc
47
47
 
48
48
  Please make sure to read the [Issue Reporting Checklist](https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md#-submitting-an-issue) before opening an issue. Issues not conforming to the guidelines may be closed immediately.
49
49
 
50
+ ## Observability
51
+
52
+ [NestJS Observe](https://observe.nestjs.com) is the official observability platform for Nest applications. Install the `@nestjs/observe` SDK, pass an API key, and requests, background jobs, errors, logs, and distributed traces start streaming to a dashboard - no manual span wiring and no collector to run. Because the SDK hooks into Nest's own request lifecycle, a trace reads like a call graph of your controllers and providers instead of a bare HTTP route. Free for up to 300,000 events a month, and there is a [live demo](https://www.observe-demo.nestjs.com/dashboard) with no signup.
53
+
50
54
  ## Consulting
51
55
 
52
56
  With official support, you can get expert help straight from the Nest core team. We provide dedicated technical support, migration strategies, advice on best practices (and design decisions), PR reviews, and team augmentation. Read more about [support here](https://enterprise.nestjs.com).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/testing",
3
- "version": "12.0.3",
3
+ "version": "12.1.0",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@testing)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -41,5 +41,5 @@
41
41
  "optional": true
42
42
  }
43
43
  },
44
- "gitHead": "14151790e1abe870abc3bbf00f88786fc3ebe509"
44
+ "gitHead": "6739656fa3e8c98bd55883f0363a2254e6412232"
45
45
  }
package/testing-module.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Logger, } from '@nestjs/common';
2
2
  import { NestApplication, NestApplicationContext, } from '@nestjs/core';
3
- import { tryLoadPackage, loadPackageCached, isUndefined, } from '@nestjs/common/internal';
3
+ import { tryLoadPackage, loadPackageCached, isFunction, isUndefined, } from '@nestjs/common/internal';
4
4
  /**
5
5
  * @publicApi
6
6
  */
@@ -50,13 +50,23 @@ export class TestingModule extends NestApplicationContext {
50
50
  Logger.overrideLogger(options.logger);
51
51
  }
52
52
  createAdapterProxy(app, adapter) {
53
- return new Proxy(app, {
53
+ const proxy = new Proxy(app, {
54
54
  get: (receiver, prop) => {
55
55
  if (!(prop in receiver) && prop in adapter) {
56
- return adapter[prop];
56
+ const value = adapter[prop];
57
+ if (!isFunction(value)) {
58
+ return value;
59
+ }
60
+ // Called on the adapter, as on applications created by NestFactory.
61
+ // Chainable methods keep returning the application.
62
+ return (...args) => {
63
+ const result = value.apply(adapter, args);
64
+ return result === adapter ? proxy : result;
65
+ };
57
66
  }
58
67
  return receiver[prop];
59
68
  },
60
69
  });
70
+ return proxy;
61
71
  }
62
72
  }