Added a client/server test.#99
Closed
eddyystop wants to merge 1 commit intofeathersjs:masterfrom
eddyystop:chat-client-server
Closed
Added a client/server test.#99eddyystop wants to merge 1 commit intofeathersjs:masterfrom eddyystop:chat-client-server
eddyystop wants to merge 1 commit intofeathersjs:masterfrom
eddyystop:chat-client-server
Conversation
Contributor
Author
|
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'); |
Member
|
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. |
Contributor
Author
|
I've also run into weird issues starting a WebSocket server on 3030 and a REST one on 3031 both using the same cached |
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This example is documented in feathersjs-ecosystem/docs#1193
The module is named so as to run before
app.test.jsbecause of a long standing issue in Feathers.app.test.jsstarts a server usingsrc/app.js, makes some REST requests, and then closes the server. Even one such REST request prevents another server from being started, usingsrc/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.