-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(examples): add nodejs_binary cluster example (#1515)
- Loading branch information
Showing
5 changed files
with
55 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
import {INestApplication} from '@nestjs/common'; | ||
import * as request from 'supertest'; | ||
|
||
import {bootstrap} from './main'; | ||
import {bootstrap, bootstrapCluster} from './main'; | ||
|
||
describe('App', () => { | ||
let server: INestApplication; | ||
|
||
beforeAll(async () => { | ||
server = await bootstrap(3000); | ||
}); | ||
afterAll(async () => { | ||
await server.close(); | ||
}) | ||
|
||
it(`GET /`, () => { | ||
return request(server.getHttpServer()).get('/hello').expect(200).expect({ | ||
it(`GET /`, async () => { | ||
const server = await bootstrap(3000); | ||
await request(server.getHttpServer()).get('/hello').expect(200).expect({ | ||
message: 'Hello world!' | ||
}); | ||
await server.close(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,7 +180,7 @@ | |
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.21.tgz#4a9db7ef1d1671c0015e632c5fa3d46c86c58c1e" | ||
integrity sha512-nuFlRdBiqbF+PJIEVxm2jLFcQWN7q7iWEJGsBV4n7v1dbI9qXB8im2pMMKMCUZe092sQb5SQft2DHfuQGK5hqQ== | ||
|
||
"@types/superagent@*": | ||
"@types/superagent@*", "@types/superagent@^4.1.4": | ||
version "4.1.4" | ||
resolved "https://registry.yarnpkg.com/@types/superagent/-/superagent-4.1.4.tgz#63f74955a28073870cfd9c100bcacb26d72b3764" | ||
integrity sha512-SRH2q6/5/nhOkAuLXm3azRGjBYpoKCZWh138Rt1AxSIyE6/1b9uClIH2V+JfyDtjIvgr5yQqYgNUmdpbneJoZQ== | ||
|
@@ -1388,7 +1388,7 @@ [email protected]: | |
isarray "0.0.1" | ||
string_decoder "~0.10.x" | ||
|
||
readable-stream@^2.2.2, readable-stream@^2.3.5: | ||
readable-stream@^2.2.2: | ||
version "2.3.6" | ||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" | ||
integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== | ||
|
@@ -1401,6 +1401,19 @@ readable-stream@^2.2.2, readable-stream@^2.3.5: | |
string_decoder "~1.1.1" | ||
util-deprecate "~1.0.1" | ||
|
||
readable-stream@^2.3.5: | ||
version "2.3.7" | ||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" | ||
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== | ||
dependencies: | ||
core-util-is "~1.0.0" | ||
inherits "~2.0.3" | ||
isarray "~1.0.0" | ||
process-nextick-args "~2.0.0" | ||
safe-buffer "~5.1.1" | ||
string_decoder "~1.1.1" | ||
util-deprecate "~1.0.1" | ||
|
||
[email protected]: | ||
version "0.1.13" | ||
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" | ||
|