Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 8a5d52d

Browse files
committedJan 25, 2016
check
1 parent 405a0a2 commit 8a5d52d

File tree

5 files changed

+8
-39
lines changed

5 files changed

+8
-39
lines changed
 

‎karma.conf.js

+2-33
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
module.exports = function (config) {
22
config.set({
3-
4-
// base path, that will be used to resolve files and exclude
53
basePath: '',
6-
7-
// frameworks to use
84
frameworks: ['mocha'],
95

10-
// list of files / patterns to load in the browser
116
files: [
127
'tests/test-core/browser.js'
138
],
149

15-
// list of preprocessors
1610
preprocessors: {
1711
'tests/test-core/*': ['webpack']
1812
},
@@ -29,7 +23,8 @@ module.exports = function (config) {
2923
},
3024
module: {
3125
loaders: [
32-
{ test: /\.json$/, loader: 'json' }
26+
{ test: /\.json$/, loader: 'json' },
27+
{ test: /\.js$/, loader: 'transform?brfs' }
3328
]
3429
}
3530
},
@@ -40,39 +35,13 @@ module.exports = function (config) {
4035
colors: true
4136
}
4237
},
43-
44-
// test results reporter to use
45-
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
4638
reporters: ['spec'],
47-
48-
// web server port
4939
port: 9876,
50-
51-
// enable / disable colors in the output (reporters and logs)
5240
colors: true,
53-
54-
// level of logging
55-
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
5641
logLevel: config.LOG_INFO,
57-
58-
// enable / disable watching file and executing tests whenever any file changes
5942
autoWatch: false,
60-
61-
// Start these browsers, currently available:
62-
// - Chrome
63-
// - ChromeCanary
64-
// - Firefox
65-
// - Opera (has to be installed with `npm install karma-opera-launcher`)
66-
// - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
67-
// - PhantomJS
68-
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
6943
browsers: process.env.TRAVIS ? ['Firefox'] : ['Chrome'],
70-
71-
// If browser does not capture in given timeout [ms], kill it
7244
captureTimeout: 60000,
73-
74-
// Continuous Integration mode
75-
// if true, it capture browsers, run tests and exit
7645
singleRun: true
7746
})
7847
}

‎package.json

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"homepage": "https://github.com/ipfs/js-ipfs#readme",
3636
"devDependencies": {
3737
"async": "^1.5.2",
38+
"brfs": "^1.4.3",
3839
"chai": "^3.4.1",
3940
"fs-blob-store": "^5.2.1",
4041
"istanbul": "^0.4.1",
@@ -55,6 +56,7 @@
5556
"raw-loader": "^0.5.1",
5657
"rimraf": "^2.4.4",
5758
"standard": "^5.4.1",
59+
"transform-loader": "^0.2.3",
5860
"webpack": "diasdavid/webpack#81f5994"
5961
},
6062
"dependencies": {

‎src/ipfs-core/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ function IPFS (repo) {
145145
if (err) {
146146
return callback(err)
147147
}
148-
console.log('->', block.data.length)
149-
console.log('->', block.data)
150148
callback(null, {
151149
Key: multihash,
152150
Size: block.data.length

‎tests/test-core/browser.js

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe('core', function () {
1313

1414
var repoData = []
1515
repoContext.keys().forEach(function (key) {
16+
console.log(key)
1617
repoData.push({
1718
key: key.replace('./', ''),
1819
value: repoContext(key)

‎tests/test-core/test-block.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ const fs = require('fs')
88
const IPFS = require('../../src/ipfs-core')
99
const Block = require('ipfs-merkle-dag').Block
1010

11-
const isNode = !global.window
11+
// const isNode = !global.window
1212

13-
const fileA = isNode
14-
? fs.readFileSync(process.cwd() + '/tests/repo-example/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data')
15-
: new Buffer(require('raw!./../repo-example/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data'))
13+
const fileA = fs.readFileSync(process.cwd() + '/tests/repo-example/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data')
14+
// : new Buffer(require('raw!./../repo-example/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data'))
1615

1716
console.log('=>', fileA)
1817

0 commit comments

Comments
 (0)
This repository has been archived.