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

Commit 5917214

Browse files
wip
1 parent 585a48b commit 5917214

21 files changed

+18
-38
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ matrix:
66
- node_js: 4
77
env: CXX=g++-4.8
88
- node_js: 6
9-
env: CXX=g++-4.8
10-
- node_js: stable
119
env:
12-
- SAUCE=true
13-
- CXX=g++-4.8
10+
- SAUCE=true
11+
- CXX=g++-4.8
12+
- node_js: stable
13+
env: CXX=g++-4.8
1414

1515
# Make sure we have new NPM.
1616
before_install:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/interface-ipfs-core/files.spec.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,12 @@
44

55
const expect = require('chai').expect
66
const isNode = require('detect-node')
7-
const path = require('path')
87
const test = require('interface-ipfs-core')
9-
const fs = require('fs')
10-
const FactoryClient = require('../factory/factory-client')
8+
const loadFixture = require('aegir/fixtures')
119

12-
let testfile
10+
const FactoryClient = require('../factory/factory-client')
1311

14-
if (isNode) {
15-
testfile = fs.readFileSync(path.join(__dirname, '/../data/testfile.txt'))
16-
} else {
17-
testfile = require('file!../data/testfile.txt')
18-
}
12+
const testfile = loadFixture(__dirname, '../fixtures/testfile.txt')
1913

2014
// add, cat, get and ls tests from interface-ipfs-core
2115
let fc

test/interface-ipfs-core/get.spec.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,15 @@ const concat = require('concat-stream')
1010
const through = require('through2')
1111
const streamEqual = require('stream-equal')
1212
const path = require('path')
13+
const loadFixture = require('aegir/fixtures')
1314
const FactoryClient = require('../factory/factory-client')
1415

15-
let testfile
16-
17-
if (isNode) {
18-
testfile = fs.readFileSync(path.join(__dirname, '/../data/testfile.txt'))
19-
} else {
20-
testfile = require('file!../data/testfile.txt')
21-
}
16+
const testfile = loadFixture(__dirname, '../fixtures/testfile.txt')
2217

2318
let testfileBig
2419
let tfbPath
2520
if (isNode) {
26-
tfbPath = path.join(__dirname, '/../data/15mb.random')
21+
tfbPath = path.join(__dirname, '/../fixtures/15mb.random')
2722
testfileBig = fs.createReadStream(tfbPath, { bufferSize: 128 })
2823
}
2924

test/interface-ipfs-core/ls.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('ls', function () {
2424
(cb) => fc.spawnNode(cb),
2525
(node, cb) => {
2626
ipfs = node
27-
const filesPath = path.join(__dirname, '../data/test-folder')
27+
const filesPath = path.join(__dirname, '../fixtures/test-folder')
2828
ipfs.util.addFromFs(filesPath, { recursive: true }, cb)
2929
},
3030
(hashes, cb) => {

test/interface-ipfs-core/name.spec.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,9 @@
33
'use strict'
44

55
const expect = require('chai').expect
6-
const fs = require('fs')
7-
const path = require('path')
8-
const isNode = require('detect-node')
6+
const loadFixture = require('aegir/fixtures')
97

10-
let testfile
11-
12-
if (isNode) {
13-
testfile = fs.readFileSync(path.join(__dirname, '/../data/testfile.txt'))
14-
} else {
15-
testfile = require('file!../data/testfile.txt')
16-
}
8+
const testfile = loadFixture(__dirname, '../fixtures/testfile.txt')
179

1810
describe('.name', () => {
1911
let name

test/interface-ipfs-core/refs.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('.refs', () => {
2323
(cb) => fc.spawnNode(cb),
2424
(node, cb) => {
2525
ipfs = node
26-
const filesPath = path.join(__dirname, '../data/test-folder')
26+
const filesPath = path.join(__dirname, '../fixtures/test-folder')
2727
ipfs.util.addFromFs(filesPath, { recursive: true }, cb)
2828
},
2929
(hashes, cb) => {

test/ipfs-api/request-api.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('ipfsAPI request tests', () => {
5757
res.end()
5858
}).listen(6001, () => {
5959
ipfsAPI('/ip4/127.0.0.1/tcp/6001')
60-
.config.replace('test/data/r-config.json', (err) => {
60+
.config.replace('test/fixtures/r-config.json', (err) => {
6161
expect(err).to.not.exist
6262
server.close(done)
6363
})

test/ipfs-api/util.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('.util', () => {
3131
})
3232

3333
it('.streamAdd', (done) => {
34-
const tfpath = path.join(__dirname, '/../data/testfile.txt')
34+
const tfpath = path.join(__dirname, '/../fixtures/testfile.txt')
3535
const rs = fs.createReadStream(tfpath)
3636
rs.path = '' // clean the path for testing purposes
3737

@@ -43,7 +43,7 @@ describe('.util', () => {
4343
})
4444

4545
it('.fsAdd a directory', (done) => {
46-
const filesPath = path.join(__dirname, '../data/test-folder')
46+
const filesPath = path.join(__dirname, '../fixtures/test-folder')
4747
ipfs.util.addFromFs(filesPath, { recursive: true }, (err, result) => {
4848
expect(err).to.not.exist
4949
expect(result.length).to.be.above(8)
@@ -52,7 +52,7 @@ describe('.util', () => {
5252
})
5353

5454
it('.fsAdd a file', (done) => {
55-
const filePath = path.join(__dirname, '../data/testfile.txt')
55+
const filePath = path.join(__dirname, '../fixtures/testfile.txt')
5656
ipfs.util.addFromFs(filePath, (err, result) => {
5757
expect(err).to.not.exist
5858
expect(result.length).to.be.above(5)

test/tmp-disposable-nodes-addrs.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)