forked from nestjs/nest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting-module.js
More file actions
22 lines (22 loc) · 1015 Bytes
/
Copy pathtesting-module.js
File metadata and controls
22 lines (22 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express = require("express");
const optional = require("optional");
const core_1 = require("@nestjs/core");
const microservices_package_not_found_exception_1 = require("@nestjs/core/errors/exceptions/microservices-package-not-found.exception");
const { NestMicroservice } = optional('@nestjs/microservices/nest-microservice') || {};
class TestingModule extends core_1.NestApplicationContext {
constructor(container, scope, contextModule) {
super(container, scope, contextModule);
}
createNestApplication(expressInstance = express()) {
return new core_1.NestApplication(this.container, expressInstance);
}
createNestMicroservice(config) {
if (!NestMicroservice) {
throw new microservices_package_not_found_exception_1.MicroservicesPackageNotFoundException();
}
return new NestMicroservice(this.container, config);
}
}
exports.TestingModule = TestingModule;