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

fix: change cp and mv tests to the current spec #515

Merged
merged 1 commit into from
Aug 30, 2019
Merged
Show file tree
Hide file tree
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: 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