How to bring down the connection server in Grunt?

I run transport tests on the connection server, since there is no built-in web server, as in karma. There is no problem with this, only karma shuts down its web server after tests are completed, but there is no such mechanism in the protractor.

I would like to run the transport tests on the connection server and then deploy another connection server, possibly with a different configuration. So far I have managed to start another connection server on a different port, but I still have two connection servers working side by side, and I would like to close the one I used for testing.

Here is my connection configuration:

connect: { test: { options: { port: 8001, } }, production: { options: { port: 8000, keepalive: true, } } } 

and my tasks:

 grunt.registerTask('default', ['jshint', 'karma:unit', 'clean', 'requirejs', 'concat', 'uglify', 'connect:test', 'protractor:e2e']); grunt.registerTask('preview-live', ['default', 'connect:production']); 

I looked at the keepalive option, scanning my own and even grunt events , but I still can’t figure out how to do this.

+2
gruntjs protractor connect
source share

No one has answered this question yet.

See similar questions:

7
AngulrJS + Grunt + Protractor: keepAlive and watch

or similar:

2237
How to pass command line arguments to Node.js?
2201
How to decide when to use Node.js?
1648
How to quit Node.js
1203
NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack
509
Rough Watch Error - Pending ... Fatal Error: See ENOSPC
7
AngulrJS + Grunt + Protractor: keepAlive and watch
3
On the server side there is (SSI) with the grunt connect web server
one
Grunt Connect Prism Mock Server Does Not Log Requests
one
How to configure protractor to work with requirejs
one
Grunt-contrib-watch with grunt-contrib-connect support

All Articles