Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Fix ArchiveFetcher progress test
Browse files Browse the repository at this point in the history
* Logger only gets called 3 times, not 4 (as we removed a step)
* The output directory doesn't have xwalk_app_template in it any
  more, as we've removed an unpack step, so the expected directory
  path is different.
  • Loading branch information
townxelliot authored and Max Waterman committed May 9, 2014
1 parent c70cf84 commit 5394b93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/unit/archive-fetcher.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@ describe('ArchiveFetcher', function () {
var logSpy = sinon.spy(logger, 'log');

// check that the resulting output path matches tmp/bar/xwalk_app_template,
// which is out directory + zip file basename + 'xwalk_app_template'
var expected = new RegExp('tmp.+bar.+xwalk_app_template');
// which is out directory (tmp) + zip file basename (bar)
var expected = new RegExp('tmp.+bar');

var finish = function (e) {
replaceSpy.restore();
logSpy.restore();
done(e);
};

archiveFetcher.fetch('http://foo/bar.zip', 'xwalk_app_template.tar.gz', 'tmp')
archiveFetcher.fetch('http://foo/bar.zip', 'tmp')
.done(
function (result) {
logSpy.callCount.should.equal(4);
logSpy.callCount.should.equal(3);

try {
replaceSpy.callCount.should.equal(2, 'replaceSpy.callCount');
Expand Down

0 comments on commit 5394b93

Please sign in to comment.