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

Commit

Permalink
fix: change cp and mv tests to the current spec (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias authored and alanshaw committed Aug 30, 2019
1 parent 6e28136 commit b107e57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/files-mfs/cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = (createCommon, options) => {
it('should copy file, expect error', (done) => {
const testDir = `/test-${hat()}`

ipfs.files.cp([`${testDir}/c`, `${testDir}/b`], (err) => {
ipfs.files.cp(`${testDir}/c`, `${testDir}/b`, (err) => {
expect(err).to.exist()
done()
})
Expand All @@ -47,7 +47,7 @@ module.exports = (createCommon, options) => {
series([
(cb) => ipfs.files.mkdir(testDir, { p: true }, cb),
(cb) => ipfs.files.write(`${testDir}/a`, Buffer.from('TEST'), { create: true }, cb),
(cb) => ipfs.files.cp([`${testDir}/a`, `${testDir}/b`], cb)
(cb) => ipfs.files.cp(`${testDir}/a`, `${testDir}/b`, cb)
], (err) => {
expect(err).to.not.exist()
done()
Expand All @@ -57,7 +57,7 @@ module.exports = (createCommon, options) => {
it('should copy dir, expect error', (done) => {
const testDir = `/test-${hat()}`

ipfs.files.cp([`${testDir}/lv1/lv3`, `${testDir}/lv1/lv4`], (err) => {
ipfs.files.cp(`${testDir}/lv1/lv3`, `${testDir}/lv1/lv4`, (err) => {
expect(err).to.exist()
done()
})
Expand All @@ -68,7 +68,7 @@ module.exports = (createCommon, options) => {

series([
(cb) => ipfs.files.mkdir(`${testDir}/lv1/lv2`, { p: true }, cb),
(cb) => ipfs.files.cp([`${testDir}/lv1/lv2`, `${testDir}/lv1/lv3`], cb)
(cb) => ipfs.files.cp(`${testDir}/lv1/lv2`, `${testDir}/lv1/lv3`, cb)
], (err) => {
expect(err).to.not.exist()
done()
Expand Down
6 changes: 3 additions & 3 deletions src/files-mfs/mv.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = (createCommon, options) => {
it('should not move not found file/dir, expect error', (done) => {
const testDir = `/test-${hat()}`

ipfs.files.mv([`${testDir}/404`, `${testDir}/a`], (err) => {
ipfs.files.mv(`${testDir}/404`, `${testDir}/a`, (err) => {
expect(err).to.exist()
done()
})
Expand All @@ -57,7 +57,7 @@ module.exports = (createCommon, options) => {
], (err) => {
expect(err).to.not.exist()

ipfs.files.mv([`${testDir}/a`, `${testDir}/c`], (err) => {
ipfs.files.mv(`${testDir}/a`, `${testDir}/c`, (err) => {
expect(err).to.not.exist()
done()
})
Expand All @@ -70,7 +70,7 @@ module.exports = (createCommon, options) => {
ipfs.files.mkdir(`${testDir}/lv1/lv2`, { p: true }, (err) => {
expect(err).to.not.exist()

ipfs.files.mv(['/test/lv1/lv2', '/test/lv1/lv4'], (err) => {
ipfs.files.mv('/test/lv1/lv2', '/test/lv1/lv4', (err) => {
expect(err).to.not.exist()
done()
})
Expand Down

0 comments on commit b107e57

Please sign in to comment.