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

use mocha's skip for conditional tests #233

Merged
merged 2 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
112 changes: 56 additions & 56 deletions js/src/files-mfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ module.exports = (common) => {
after((done) => common.teardown(done))

describe('.mkdir', function () {
it('make directory on root', (done) => {
it('make directory on root', function(done) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails on linting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?
The lint pass locally and on travis.
Do you want function (done) with a space instead ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelMure weird, I could bet that standard wouldn't accept that. Yeah I do want the whitespace to make it consistent :)

if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.mkdir('/test', (err) => {
Expand All @@ -49,10 +49,10 @@ module.exports = (common) => {
})
})

it('make directory and its parents', (done) => {
it('make directory and its parents', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.mkdir('/test/lv1/lv2', { p: true }, (err) => {
Expand All @@ -61,10 +61,10 @@ module.exports = (common) => {
})
})

it('make already existent directory', (done) => {
it('make already existent directory', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.mkdir('/', (err) => {
Expand All @@ -75,10 +75,10 @@ module.exports = (common) => {
})

describe('.write', function () {
it('expect error', (done) => {
it('expect error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.write('/test/a', Buffer.from('Hello, world!'), (err) => {
Expand All @@ -87,10 +87,10 @@ module.exports = (common) => {
})
})

it('expect no error', (done) => {
it('expect no error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.write('/test/a', Buffer.from('Hello, world!'), {create: true}, (err) => {
Expand All @@ -101,10 +101,10 @@ module.exports = (common) => {
})

describe('.cp', function () {
it('copy file, expect error', (done) => {
it('copy file, expect error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.cp(['/test/c', '/test/b'], (err) => {
Expand All @@ -113,10 +113,10 @@ module.exports = (common) => {
})
})

it('copy file, expect no error', (done) => {
it('copy file, expect no error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.cp(['/test/a', '/test/b'], (err) => {
Expand All @@ -125,10 +125,10 @@ module.exports = (common) => {
})
})

it('copy dir, expect error', (done) => {
it('copy dir, expect error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.cp(['/test/lv1/lv3', '/test/lv1/lv4'], (err) => {
Expand All @@ -137,10 +137,10 @@ module.exports = (common) => {
})
})

it('copy dir, expect no error', (done) => {
it('copy dir, expect no error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.cp(['/test/lv1/lv2', '/test/lv1/lv3'], (err) => {
Expand All @@ -151,10 +151,10 @@ module.exports = (common) => {
})

describe('.mv', function () {
it('move file, expect error', (done) => {
it('move file, expect error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.mv(['/test/404', '/test/a'], (err) => {
Expand All @@ -163,10 +163,10 @@ module.exports = (common) => {
})
})

it('move file, expect no error', (done) => {
it('move file, expect no error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.mv(['/test/a', '/test/c'], (err) => {
Expand All @@ -175,10 +175,10 @@ module.exports = (common) => {
})
})

it('move dir, expect error', (done) => {
it('move dir, expect error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.mv(['/test/lv1/404', '/test/lv1'], (err) => {
Expand All @@ -187,10 +187,10 @@ module.exports = (common) => {
})
})

it('move dir, expect no error', (done) => {
it('move dir, expect no error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.mv(['/test/lv1/lv2', '/test/lv1/lv4'], (err) => {
Expand All @@ -201,10 +201,10 @@ module.exports = (common) => {
})

describe('.rm', function () {
it('remove file, expect error', (done) => {
it('remove file, expect error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.rm('/test/a', (err) => {
Expand All @@ -213,10 +213,10 @@ module.exports = (common) => {
})
})

it('remove file, expect no error', (done) => {
it('remove file, expect no error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.rm('/test/c', (err) => {
Expand All @@ -225,10 +225,10 @@ module.exports = (common) => {
})
})

it('remove dir, expect error', (done) => {
it('remove dir, expect error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.rm('/test/lv1/lv4', (err) => {
Expand All @@ -237,10 +237,10 @@ module.exports = (common) => {
})
})

it('remove dir, expect no error', (done) => {
it('remove dir, expect no error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.rm('/test/lv1/lv4', {recursive: true}, (err) => {
Expand All @@ -251,10 +251,10 @@ module.exports = (common) => {
})

describe('.stat', function () {
it('stat not found, expect error', (done) => {
it('stat not found, expect error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.stat('/test/404', (err) => {
Expand All @@ -263,10 +263,10 @@ module.exports = (common) => {
})
})

it('stat file', (done) => {
it('stat file', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.stat('/test/b', (err, stat) => {
Expand All @@ -282,10 +282,10 @@ module.exports = (common) => {
})
})

it('stat dir', (done) => {
it('stat dir', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.stat('/test', (err, stat) => {
Expand All @@ -303,10 +303,10 @@ module.exports = (common) => {
})

describe('.read', function () {
it('read not found, expect error', (done) => {
it('read not found, expect error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.read('/test/404', (err, buf) => {
Expand All @@ -316,10 +316,10 @@ module.exports = (common) => {
})
})

it('read file', (done) => {
it('read file', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.read('/test/b', (err, buf) => {
Expand All @@ -331,10 +331,10 @@ module.exports = (common) => {
})

describe('.ls', function () {
it('ls not found, expect error', (done) => {
it('ls not found, expect error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.ls('/test/404', (err, info) => {
Expand All @@ -344,10 +344,10 @@ module.exports = (common) => {
})
})

it('ls directory', (done) => {
it('ls directory', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.ls('/test', (err, info) => {
Expand All @@ -360,10 +360,10 @@ module.exports = (common) => {
})
})

it('ls -l directory', (done) => {
it('ls -l directory', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.ls('/test', { l: true }, (err, info) => {
Expand All @@ -388,10 +388,10 @@ module.exports = (common) => {
})

describe('.flush', function () {
it('flush not found, expect error', (done) => {
it('flush not found, expect error', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.flush('/test/404', (err) => {
Expand All @@ -400,10 +400,10 @@ module.exports = (common) => {
})
})

it('flush root', (done) => {
it('flush root', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.flush((err) => {
Expand All @@ -412,10 +412,10 @@ module.exports = (common) => {
})
})

it('flush specific dir', (done) => {
it('flush specific dir', function(done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
return done()
this.skip()
}

ipfs.files.flush('/test', (err) => {
Expand Down
Loading