diff options
| author | Igor Minar | 2011-09-21 02:47:12 +0200 | 
|---|---|---|
| committer | Igor Minar | 2011-10-03 12:24:29 -0700 | 
| commit | 2f128c96191825139fe9eb1b43b0e3f5b5265440 (patch) | |
| tree | eefe520a7e97f62647c1b6d7c4e2527ae54be0ba /docs/src/writer.js | |
| parent | f7a5f1788a794d082a05e48f728b22b47a6cc622 (diff) | |
| download | angular.js-2f128c96191825139fe9eb1b43b0e3f5b5265440.tar.bz2 | |
fix(e2e): add index-nocache.html to run e2e tests without cachev0.9.x
using appcache while running e2e tests was causing the following
problems:
- Safari would occasionally reload the app (as a result of the appcache
  refresh) during the angular.validator.asychronous test, which would
  result in test failure and false positivy.
- Firefox6 would run the tests very slowly, disabling the cache resolved
  the latency issues
- Sometimes tests would run with stale code pulled from cache, which
  would result in flaky tests.
Diffstat (limited to 'docs/src/writer.js')
| -rw-r--r-- | docs/src/writer.js | 19 | 
1 files changed, 16 insertions, 3 deletions
| diff --git a/docs/src/writer.js b/docs/src/writer.js index b33e4164..a7fb227e 100644 --- a/docs/src/writer.js +++ b/docs/src/writer.js @@ -44,12 +44,25 @@ exports.copyTpl = function(filename) {    return exports.copy('docs/src/templates/' + filename, OUTPUT_DIR + filename);  }; -exports.copy = function (from, to, replacementKey, replacement) { +exports.copy = function (from, to) { +  var args = [].slice.call(arguments); + +  args.shift(); // drop 'from' +  args.shift(); // drop 'to' +    // Have to use rb (read binary), char 'r' is infered by library.    return qfs.read(from,'b').then(function(content) { -    if(replacementKey && replacement) { -      content = content.toString().replace(replacementKey, replacement); +    var replacementKey, +        replacement; + +    while (args.length) { +      replacementKey = args.shift(); +      replacement = args.shift(); +      if(replacementKey != undefined && replacement != undefined) { +        content = content.toString().replace(replacementKey, replacement); +      }      } +      qfs.write(to, content);    });  } | 
