aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-css-plugin/css-bundle/tests/server.test.ts
diff options
context:
space:
mode:
authorTibor Blenessy2020-01-13 11:44:34 +0100
committerGitHub2020-01-13 11:44:34 +0100
commit13d52b7dd495c68c72ad8ab3f5063307bf42cfad (patch)
tree057fd574afec4bd7f32283088c9fa2d8b8c66360 /sonar-css-plugin/css-bundle/tests/server.test.ts
parentc0ba07e77931f187a788c7b1ab5420ead525e3d3 (diff)
downloadsonar-css-13d52b7dd495c68c72ad8ab3f5063307bf42cfad.tar.bz2
Implement close endpoint to shutdown the Node.js process (#243)
Diffstat (limited to 'sonar-css-plugin/css-bundle/tests/server.test.ts')
-rw-r--r--sonar-css-plugin/css-bundle/tests/server.test.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/sonar-css-plugin/css-bundle/tests/server.test.ts b/sonar-css-plugin/css-bundle/tests/server.test.ts
index 84fc617..8574129 100644
--- a/sonar-css-plugin/css-bundle/tests/server.test.ts
+++ b/sonar-css-plugin/css-bundle/tests/server.test.ts
@@ -167,3 +167,12 @@ describe("server", () => {
return postToServer(data, endpoint, server);
}
});
+
+describe("server close", () => {
+ it("should stop listening when closed", async () => {
+ const server = await start();
+ expect(server.listening).toBeTruthy();
+ await postToServer("", "/close", server);
+ expect(server.listening).toBeFalsy();
+ });
+});