Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
test: make refs tests iteration order independent (#2982)
Browse files Browse the repository at this point in the history
  • Loading branch information
koivunej authored Jun 8, 2020
1 parent 23cace0 commit a8b4082
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions packages/interface-ipfs-core/src/refs.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ module.exports = (common, options) => {

const refs = await all(ipfs.refs(p, params))

// Sort the refs not to lock-in the iteration order
// Check there was no error and the refs match what was expected
expect(refs.map(r => r.ref)).to.eql(expected)
expect(refs.map(r => r.ref).sort()).to.eql(expected.sort())
})
}

Expand Down Expand Up @@ -207,19 +208,19 @@ function getRefsTests () {
},

'should get refs with recursive and unique option': {
params: { format: '<linkname>', recursive: true, unique: true },
params: { format: '<dst>', recursive: true, unique: true },
expected: [
'animals',
'land',
'african.txt',
'americas.txt',
'australian.txt',
'sea',
'atlantic.txt',
'indian.txt',
'fruits',
'tropical.txt',
'mushroom.txt'
'QmRfqT4uTUgFXhWbfBZm6eZxi2FQ8pqYK5tcWRyTZ7RcgY',
'QmUXzZKa3xhTauLektUiK4GiogHskuz1c57CnnoP4TgYJD',
'QmVX54jfjB8eRxLVxyQSod6b1FyDh7mR4mQie9j97i2Qk3',
'QmWEuXAjUGyndgr4MKqMBgzMW36XgPgvitt2jsXgtuc7JE',
'QmYEJ7qQNZUvBnv4SZ3rEbksagaan3sGvnUq948vSG8Z34',
'QmYLvZrFn8KE2bcJ9UFhthScBVbbcXEgkJnnCBeKWYkpuQ',
'Qma5z9bmwPcrWLJxX6Vj6BrcybaFg84c2riNbUKrSVf8h1',
'QmbrFTo4s6H23W6wmoZKQC2vSogGeQ4dYiceSqJddzrKVa',
'QmdHVR8M4zAdGctnTYq4fyPZjTwwzdcBpGWAfMAhAVfT9n',
'Qmf6MrqT2oAve9diagLTMCYFPEcSx7fnUdW3xAjhXm32vo',
'QmfP6D9bRV4FEYDL4EHZtZG58kDwDfnzmyjuyK5d1pvzbM'
]
},

Expand Down

0 comments on commit a8b4082

Please sign in to comment.