| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
It looks like there is something stateful somewhere. This solves all issues I've run into delete require.cache[require.resolve('../src1/app')]
app = require('../src1/app'); |
Sorry, something went wrong.
|
What I usually do is start the other server on a different port but you're right, the current test should shut the server down. I'll have a look at it as well. |
Sorry, something went wrong.
|
I've also run into weird issues starting a WebSocket server on 3030 and a REST one on 3031 both using the same cached require(../src/app). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This example is documented in feathersjs-ecosystem/docs#1193
The module is named so as to run before app.test.js because of a long standing issue in Feathers. app.test.js starts a server using src/app.js, makes some REST requests, and then closes the server. Even one such REST request prevents another server from being started, using src/app.js, on which socket.io calls are made. (There are no issues with multiple servers using socket.io.)
The added test runs fine before app.test.js. It fails when run afterwards.
Matt's article about client/server testing does not have a solution to this situation.
It would be nice to at least understand what is going on. The situation forces socketio tests to be run before REST ones, even though interleaving them is the natural thing to do.