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

Commit cbe6582

Browse files
use new aegir fixtures
1 parent 7eb8dbc commit cbe6582

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

.aegir.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict'
2+
3+
module.exports = {
4+
karma: {
5+
files: [{
6+
pattern: 'node_modules/interface-ipfs-core/test/fixtures/**/*',
7+
watched: false,
8+
served: true,
9+
included: false
10+
}]
11+
}
12+
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ const loadFixture = require('aegir/fixtures')
99

1010
const FactoryClient = require('../factory/factory-client')
1111

12-
const testfile = loadFixture(__dirname, '../fixtures/testfile.txt')
12+
let testfile
13+
if (isNode) {
14+
testfile = loadFixture(__dirname, '../fixtures/testfile.txt')
15+
} else {
16+
testfile = loadFixture(__dirname, 'fixtures/testfile.txt')
17+
}
1318

1419
// add, cat, get and ls tests from interface-ipfs-core
1520
let fc

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ const path = require('path')
1313
const loadFixture = require('aegir/fixtures')
1414
const FactoryClient = require('../factory/factory-client')
1515

16-
const testfile = loadFixture(__dirname, '../fixtures/testfile.txt')
17-
16+
let testfile
1817
let testfileBig
1918
let tfbPath
2019
if (isNode) {
21-
tfbPath = path.join(__dirname, '/../fixtures/15mb.random')
20+
tfbPath = path.join(__dirname, '../fixtures/15mb.random')
2221
testfileBig = fs.createReadStream(tfbPath, { bufferSize: 128 })
22+
testfile = loadFixture(__dirname, '../fixtures/testfile.txt')
23+
} else {
24+
testfile = loadFixture(__dirname, 'fixtures/testfile.txt')
2325
}
2426

2527
describe('.get', () => {

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33
'use strict'
44

55
const expect = require('chai').expect
6+
const isNode = require('detect-node')
67
const loadFixture = require('aegir/fixtures')
78

8-
const testfile = loadFixture(__dirname, '../fixtures/testfile.txt')
9+
let testfile
10+
if (isNode) {
11+
testfile = loadFixture(__dirname, '../fixtures/testfile.txt')
12+
} else {
13+
testfile = loadFixture(__dirname, 'fixtures/testfile.txt')
14+
}
915

1016
describe('.name', () => {
1117
let name

0 commit comments

Comments
 (0)