@nmxjs/app 1.0.45 → 1.0.46
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/createTestNestApp.d.ts +6 -0
- package/dist/createTestNestApp.js +24 -0
- package/dist/createTestNestApp.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Test } from '@nestjs/testing';
|
|
2
|
+
import { ClientProxy } from '@nestjs/microservices';
|
|
3
|
+
export declare function createTestNestApp(module: Parameters<typeof Test.createTestingModule>[0]): Promise<{
|
|
4
|
+
app: import("@nestjs/common").INestApplication<any>;
|
|
5
|
+
client: ClientProxy;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTestNestApp = void 0;
|
|
4
|
+
const testing_1 = require("@nestjs/testing");
|
|
5
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
6
|
+
async function createTestNestApp(module) {
|
|
7
|
+
const clientKey = Symbol('CLIENT_KEY');
|
|
8
|
+
module.imports.push(microservices_1.ClientsModule.register([{ name: clientKey, transport: microservices_1.Transport.TCP }]));
|
|
9
|
+
const moduleFixture = await testing_1.Test.createTestingModule(module).compile();
|
|
10
|
+
const app = moduleFixture.createNestApplication();
|
|
11
|
+
app.connectMicroservice({
|
|
12
|
+
transport: microservices_1.Transport.TCP,
|
|
13
|
+
});
|
|
14
|
+
await app.startAllMicroservices();
|
|
15
|
+
await app.init();
|
|
16
|
+
const client = app.get(clientKey);
|
|
17
|
+
await client.connect();
|
|
18
|
+
return {
|
|
19
|
+
app,
|
|
20
|
+
client,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
exports.createTestNestApp = createTestNestApp;
|
|
24
|
+
//# sourceMappingURL=createTestNestApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTestNestApp.js","sourceRoot":"","sources":["../src/createTestNestApp.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AACvC,yDAA8E;AAEvE,KAAK,UAAU,iBAAiB,CAAC,MAAsD;IAC5F,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;IAEvC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,6BAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,yBAAS,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAE7F,MAAM,aAAa,GAAG,MAAM,cAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC;IACvE,MAAM,GAAG,GAAG,aAAa,CAAC,qBAAqB,EAAE,CAAC;IAElD,GAAG,CAAC,mBAAmB,CAAC;QACtB,SAAS,EAAE,yBAAS,CAAC,GAAG;KACzB,CAAC,CAAC;IAEH,MAAM,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAClC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAEjB,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAAc,SAAS,CAAC,CAAC;IAC/C,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IAEvB,OAAO;QACL,GAAG;QACH,MAAM;KACP,CAAC;AACJ,CAAC;AAtBD,8CAsBC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './createNestApp';
|
|
|
4
4
|
export * from './getTypeOrmModule';
|
|
5
5
|
export * from './getGraphQlModule';
|
|
6
6
|
export * from './createNestHttpApp';
|
|
7
|
+
export * from './createTestNestApp';
|
|
7
8
|
export * from './ExtraRepository';
|
|
8
9
|
export * from './GqlExceptionFilter';
|
|
9
10
|
export * from './createTestNestHttpApp';
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __exportStar(require("./createNestApp"), exports);
|
|
|
20
20
|
__exportStar(require("./getTypeOrmModule"), exports);
|
|
21
21
|
__exportStar(require("./getGraphQlModule"), exports);
|
|
22
22
|
__exportStar(require("./createNestHttpApp"), exports);
|
|
23
|
+
__exportStar(require("./createTestNestApp"), exports);
|
|
23
24
|
__exportStar(require("./ExtraRepository"), exports);
|
|
24
25
|
__exportStar(require("./GqlExceptionFilter"), exports);
|
|
25
26
|
__exportStar(require("./createTestNestHttpApp"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,kDAAgC;AAChC,kDAAgC;AAChC,qDAAmC;AACnC,qDAAmC;AACnC,sDAAoC;AACpC,oDAAkC;AAClC,uDAAqC;AACrC,0DAAwC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,kDAAgC;AAChC,kDAAgC;AAChC,qDAAmC;AACnC,qDAAmC;AACnC,sDAAoC;AACpC,sDAAoC;AACpC,oDAAkC;AAClC,uDAAqC;AACrC,0DAAwC"}
|