New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(test): Mocha DSL for event tests #1928
Conversation
tests/test_events.js
Outdated
nock('http://example.test') | ||
.get('/') | ||
.reply(418) | ||
|
||
const assertion = function(req) { | ||
nock.emitter.on('no match', req => { | ||
expect(req.path).to.equal('/definitelymaybe') | ||
nock.emitter.removeAllListeners('no match') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be moved into an afterEach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved removeAllListeners
to the global afterEach
. I seemed like it belongs there.
tests/test_events.js
Outdated
nock.disableNetConnect() | ||
nock.emitter.on('no match', function(req) { | ||
|
||
nock.emitter.on('no match', req => { | ||
expect(req.hostname).to.equal('example.test') | ||
nock.emitter.removeAllListeners('no match') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
🎉 This PR is included in version 12.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.