Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): file.spec.131 moveTo may fail due to read order assumption #643

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1941,8 +1941,12 @@ exports.defineAutoTests = function () {
directoryReader.readEntries(function successRead (entries) {
expect(entries.length).toBe(2);
if (!isChrome) {
expect(entries[0].name).toBe(srcDirNestedFirst);
expect(entries[1].name).toBe(srcDirNestedSecond);
// Directory read order is undefined on some platforms, therefore we cannot assume order
// So we will start with an expected list and iterate over the entries and test to see if they
// are in our expectation list. When found we will remove them. At the end, our expectation list
// should be empty.
const expected = [srcDirNestedFirst, srcDirNestedSecond];
expect(entries.map((entry) => entry.name)).toEqual(jasmine.arrayWithExactContents(expected));
}
deleteEntry(dstDir, done);
}, failed.bind(null, done, 'Error getting entries from: ' + transferredDirectory));
Expand Down
Loading