Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Unit tests for StaticServerDomain #2992

Merged
merged 3 commits into from
Feb 28, 2013
Merged

Unit tests for StaticServerDomain #2992

merged 3 commits into from
Feb 28, 2013

Conversation

njx
Copy link
Contributor

@njx njx commented Feb 28, 2013

Basic unit tests for the node code used to implement the HTTP live development server.

@joelrbrandt or @redmunds should look at this.

@joelrbrandt
Copy link
Contributor

I'll look at this first thing in the morning. I'm leaving it unassigned in case @redmunds wants to grab it first. :-)

@joelrbrandt
Copy link
Contributor

Reviewing...

@ghost ghost assigned joelrbrandt Feb 28, 2013
var pathKey = PATH_KEY_PREFIX + path;
if (_servers[pathKey]) {
_servers[pathKey].close();
delete _servers[pathKey];
Copy link
Contributor

Choose a reason for hiding this comment

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

We should delete first, then call close. Close could throw. If it throws, the domain manager will catch the exception and forward a notification to the user (so it's fine that we're not catching the exception here). But we'll be left in this weird state where a broken server is still in the _servers array.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll make this fix since it's just a re-ordering and @njx is out today.

@joelrbrandt
Copy link
Contributor

These tests look great! Found a few minor nits which I'll fix myself (since @njx is out) and then merge.

This will mess up #2993 because of the changes to main.js, which I will fix.

joelrbrandt added a commit that referenced this pull request Feb 28, 2013
Unit tests for StaticServerDomain
@joelrbrandt joelrbrandt merged commit 86594b4 into master Feb 28, 2013
@joelrbrandt joelrbrandt deleted the nj/http-server-unit branch February 28, 2013 14:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants