Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use the default message in common.mustNotCall
  • Loading branch information
XadillaX committed Jun 10, 2017
commit b3a1ac6e7f357063c14126a1e4bf1dac76130303
2 changes: 1 addition & 1 deletion test/parallel/test-https-immutable-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const server1 = https.createServer(opts);
assert.deepStrictEqual(opts, { foo: 'bar' });
assert.strictEqual(server1.NPNProtocols.compare(dftProtocol.NPNProtocols), 0);

@mscdex mscdex Jun 10, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should suffice to just compare the NPNProtocols references. That way we know for sure that our options weren't overridden:

assert.strictEqual(server1.NPNProtocols, dftProtocol.NPNProtocols);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mscdex I think we can't, because NPNProtocols hasn't been cached yet. 2 calls to tls.convertNPNProtocols won't return the same reference.

@mscdex mscdex Jun 10, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok I see it now. Perhaps we should at least choose a different set of protocols then, so as to differentiate from the default NPN protocols (perhaps just use one protocol?).


const mustNotCall = common.mustNotCall('dummy callback');
const mustNotCall = common.mustNotCall();
const server2 = https.createServer(mustNotCall);

@mscdex mscdex Jun 10, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment below doesn't match the behavior of this line. If we're testing no arguments, it should just be https.createServer().

Otherwise we could add a separate test below for no arguments.


assert.strictEqual(server2.NPNProtocols.compare(dftProtocol.NPNProtocols), 0);
Expand Down