Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUse memory chunk store for unit tests #871
Conversation
Corrected webseed test to follow fixtures and tracker magnet.
| @@ -15,7 +16,7 @@ test('Download using HTTP tracker (via magnet uri)', function (t) { | |||
| }) | |||
|
|
|||
| function magnetDownloadTest (t, serverType) { | |||
| t.plan(10) | |||
| t.plan(11) | |||
This comment has been minimized.
This comment has been minimized.
yciabaud
Jul 21, 2016
Author
Contributor
This test was not passing with an empty store, I assume this is the good number.
This comment has been minimized.
This comment has been minimized.
feross
Jul 23, 2016
Member
It looks like 10 is the right number, we should figure out why this needed to be changed to 11 to pass with an empty store.
This comment has been minimized.
This comment has been minimized.
feross
Jul 23, 2016
Member
Okay, so this was a timing thing. Basically now noPeers is getting emitted twice because the tracker gets sent a 'started' then a 'completed' message and both times there are no peers in the response. I changed the .on('noPeers') to .once('noPeers') so this will be more reliable.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| @@ -10,7 +11,7 @@ var WebTorrent = require('../../') | |||
| test('Download using webseed (via magnet uri)', function (t) { | |||
| t.plan(9) | |||
|
|
|||
| var serve = serveStatic(path.join(__dirname, 'content')) | |||
| var serve = serveStatic(path.dirname(fixtures.leaves.contentPath)) | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I focused on downloading tests but maybe all the tests are concerned. |
Okay, so this was a timing thing. Basically now noPeers is getting
emitted twice because the tracker gets sent a 'started' then a
'completed' message and both times there are no peers in the response.
I changed the .on('noPeers') to .once('noPeers') so this will be more
reliable.
#871 (comment)
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
May 4, 2018
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
yciabaud commentedJul 21, 2016
The webseed tests were not using fixtures module but passed anyway because the fs store was already populated with the data of a previous test.
This PR uses memory chunk store to ensure the store is empty before running a test.