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

Commit 929a073

Browse files
committedOct 26, 2015
remove some tests from browser context through isNode
1 parent d65f6f1 commit 929a073

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed
 

‎test/tests.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var fs = require('fs')
44
var path = require('path')
55
var File = require('vinyl')
66

7-
// var isNode = !global.window
7+
var isNode = !global.window
88

99
// this comment is used by mocha, do not delete
1010
/* global describe, before, it */
@@ -76,6 +76,10 @@ describe('IPFS Node.js API wrapper tests', function () {
7676

7777
describe('.add', function () {
7878
it('add file', function (done) {
79+
if (!isNode) {
80+
return done()
81+
}
82+
7983
this.timeout(10000)
8084

8185
var file = new File({
@@ -109,8 +113,11 @@ describe('IPFS Node.js API wrapper tests', function () {
109113
})
110114
})
111115

112-
// Not working due to fs.lstat not being available in the browser
113116
it('add path', function (done) {
117+
if (!isNode) {
118+
return done()
119+
}
120+
114121
this.timeout(10000)
115122

116123
apiClients['a'].add(testfilePath, function (err, res) {
@@ -123,6 +130,9 @@ describe('IPFS Node.js API wrapper tests', function () {
123130
})
124131

125132
it('add a nested dir', function (done) {
133+
if (!isNode) {
134+
return done()
135+
}
126136
this.timeout(10000)
127137

128138
apiClients['a'].add(__dirname + '/test-folder', { recursive: true }, function (err, res) {
@@ -165,6 +175,10 @@ describe('IPFS Node.js API wrapper tests', function () {
165175
describe('.ls', function () {
166176
var folder = 'QmaMTzaGBmdLrispnPRTESta4yDQdK4uKSVcQez2No4h6q'
167177
it('ls', function (done) {
178+
if (!isNode) {
179+
return done()
180+
}
181+
168182
this.timeout(100000)
169183

170184
apiClients['a'].ls(folder, function (err, res) {

0 commit comments

Comments
 (0)
This repository has been archived.