Skip to content

Commit 123e2db

Browse files
committed
make sure both entry event and end event entries are what we expect
1 parent 3d60252 commit 123e2db

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

test/tests/tree.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ describe("Tree", function() {
2424
it("walks its entries and returns the same entries on both progress and end",
2525
function() {
2626
var repo = this.repository;
27+
var file1 = "test.txt";
28+
var file2 = "foo/bar.txt";
29+
var expectedPaths = [file1, file2];
2730
var progressEntries = [];
2831
var endEntries;
2932

30-
return RepoUtils.commitFileToRepo(repo, "test.txt", "")
33+
return RepoUtils.commitFileToRepo(repo, file1, "")
3134
.then(function(commit) {
32-
return RepoUtils.commitFileToRepo(repo, "foo/bar.txt", "", commit);
35+
return RepoUtils.commitFileToRepo(repo, file2, "", commit);
3336
})
3437
.then(function(commit) {
3538
return commit.getTree();
@@ -56,21 +59,21 @@ describe("Tree", function() {
5659
assert(progressEntries.length);
5760
assert(endEntries && endEntries.length);
5861

59-
assert.equal(
60-
progressEntries.length, endEntries.length,
61-
"Different number of progress entries and end entries"
62-
);
63-
6462
function getEntryPath(entry) {
6563
return entry.path();
6664
}
6765

68-
var progressFilePaths = progressEntries.map(getEntryPath).sort();
66+
var progressFilePaths = progressEntries.map(getEntryPath);
6967
var endFilePaths = endEntries.map(getEntryPath);
7068

7169
assert.deepEqual(
72-
progressFilePaths.sort(), endFilePaths.sort(),
73-
"progress entries do not match end entries"
70+
expectedPaths, progressFilePaths,
71+
"progress entry paths do not match expected paths"
72+
);
73+
74+
assert.deepEqual(
75+
expectedPaths, endFilePaths,
76+
"end entry paths do not match expected paths"
7477
);
7578
});
7679
});

0 commit comments

Comments
 (0)