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

Commit b107e57

Browse files
hugomrdiasAlan Shaw
authored and
Alan Shaw
committed
fix: change cp and mv tests to the current spec (#515)
1 parent 6e28136 commit b107e57

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: src/files-mfs/cp.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = (createCommon, options) => {
3535
it('should copy file, expect error', (done) => {
3636
const testDir = `/test-${hat()}`
3737

38-
ipfs.files.cp([`${testDir}/c`, `${testDir}/b`], (err) => {
38+
ipfs.files.cp(`${testDir}/c`, `${testDir}/b`, (err) => {
3939
expect(err).to.exist()
4040
done()
4141
})
@@ -47,7 +47,7 @@ module.exports = (createCommon, options) => {
4747
series([
4848
(cb) => ipfs.files.mkdir(testDir, { p: true }, cb),
4949
(cb) => ipfs.files.write(`${testDir}/a`, Buffer.from('TEST'), { create: true }, cb),
50-
(cb) => ipfs.files.cp([`${testDir}/a`, `${testDir}/b`], cb)
50+
(cb) => ipfs.files.cp(`${testDir}/a`, `${testDir}/b`, cb)
5151
], (err) => {
5252
expect(err).to.not.exist()
5353
done()
@@ -57,7 +57,7 @@ module.exports = (createCommon, options) => {
5757
it('should copy dir, expect error', (done) => {
5858
const testDir = `/test-${hat()}`
5959

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

6969
series([
7070
(cb) => ipfs.files.mkdir(`${testDir}/lv1/lv2`, { p: true }, cb),
71-
(cb) => ipfs.files.cp([`${testDir}/lv1/lv2`, `${testDir}/lv1/lv3`], cb)
71+
(cb) => ipfs.files.cp(`${testDir}/lv1/lv2`, `${testDir}/lv1/lv3`, cb)
7272
], (err) => {
7373
expect(err).to.not.exist()
7474
done()

Diff for: src/files-mfs/mv.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = (createCommon, options) => {
4242
it('should not move not found file/dir, expect error', (done) => {
4343
const testDir = `/test-${hat()}`
4444

45-
ipfs.files.mv([`${testDir}/404`, `${testDir}/a`], (err) => {
45+
ipfs.files.mv(`${testDir}/404`, `${testDir}/a`, (err) => {
4646
expect(err).to.exist()
4747
done()
4848
})
@@ -57,7 +57,7 @@ module.exports = (createCommon, options) => {
5757
], (err) => {
5858
expect(err).to.not.exist()
5959

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

73-
ipfs.files.mv(['/test/lv1/lv2', '/test/lv1/lv4'], (err) => {
73+
ipfs.files.mv('/test/lv1/lv2', '/test/lv1/lv4', (err) => {
7474
expect(err).to.not.exist()
7575
done()
7676
})

0 commit comments

Comments
 (0)