From a23b879bd5dfc3de65db8b5137f7c847839d75e0 Mon Sep 17 00:00:00 2001 From: bastimeyer Date: Fri, 12 Dec 2014 20:07:48 +0100 Subject: [PATCH] Fixed zip-app test failing sometimes DecompressZip's list() method sometimes returns a different order of the file list. This can be fixed by simply sorting the expected and the returned array. --- test/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/utils.js b/test/utils.js index 70f70add..fc7a733f 100644 --- a/test/utils.js +++ b/test/utils.js @@ -122,7 +122,7 @@ test('should zip the app and create the app.nw file + log it', function (t) { }, { "src" : path.normalize("test/fixtures/nwapp/package.json"), "dest": path.normalize("package.json") - }], expected = _.pluck(files, 'dest'); + }], expected = _.pluck(files, 'dest').sort(); var _evt = new EventEmitter(); _evt.on('log', function (logging) { @@ -132,7 +132,7 @@ test('should zip the app and create the app.nw file + log it', function (t) { utils.generateZipFile(files, _evt).then(function(nwfile) { var unzipper = new DecompressZip(nwfile); unzipper.on('list', function (files) { - t.deepEqual(expected, files); + t.deepEqual(expected, files.sort()); }); unzipper.list(); });