Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Unwatch only matched paths

  • Loading branch information...
commit 907122c0e30b760b95488bdc000d9a82a3c06ce5 1 parent f45eef0
Yohan Boniface yohanboniface authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 casperserver.js
9 casperserver.js
View
@@ -86,18 +86,19 @@ Server.prototype._serve = function serve(request, response) {
// Handle response
var options = {};
for (var path in this.watchedPaths) {
+ this.log(path)
if (request.url.search(path) !== -1) {
options = this.watchedPaths[path];
this.log("Build response from watched path " + request.url);
+ if (!options.permanent) {
+ // Automatically unwatch path, not to pollute tests context
+ this.unwatchPath(path);
+ }
break;
}
}
options._request = request;
this._buildResponse(response, options);
- if (!options.permanent) {
- // Automatically unwatch path, not to pollute tests context
- this.unwatchPath(path);
- }
};
Please sign in to comment.
Something went wrong with that request. Please try again.