Skip to content

Commit 4d5d968

Browse files
committed
Merge pull request #20 from wheresrhys/bugfixes
Bugfixes
2 parents ce0d254 + ffad7c6 commit 4d5d968

File tree

10 files changed

+319
-354
lines changed

10 files changed

+319
-354
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ sudo: false
22
language: node_js
33
script: npm test
44
node_js:
5-
- '0.12'
5+
- '4'
66
before_install:
77
- export CHROME_BIN=chromium-browser
88
- export DISPLAY=:99.0
@@ -19,4 +19,4 @@ deploy:
1919
on:
2020
all_branches: true
2121
tags: true
22-
repo: wheresrhys/fetch-mock
22+
repo: wheresrhys/fetch-mock

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@
33
test:
44
mocha test/server.js
55
./node_modules/karma/bin/karma start --single-run
6-
7-
coverage:
8-
# mocha test/server.js -R mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js

README.md

Lines changed: 115 additions & 114 deletions
Large diffs are not rendered by default.

client.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use strict';
22

3-
var FetchMock = require('./src/fetch-mock');
3+
const FetchMock = require('./src/fetch-mock');
44

55
module.exports = new FetchMock({
66
theGlobal: window,
77
Response: window.Response,
88
Headers: window.Headers,
9-
Blob: window.Blob
9+
Blob: window.Blob,
10+
debug: function () {}
1011
});

karma.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ module.exports = function(karma) {
1212
'test/client.js': ['browserify']
1313
},
1414
browserify: {
15-
transform: ['debowerify'],
15+
transform: ['babelify', 'debowerify'],
1616
debug: true
1717
},
18-
browsers: ['PhantomJS', 'Chrome'],
18+
browsers: ['Chrome'],
1919
customLaunchers: {
2020
Chrome_travis_ci: {
2121
base: 'Chrome',
@@ -25,7 +25,7 @@ module.exports = function(karma) {
2525
};
2626

2727
if(process.env.TRAVIS){
28-
configuration.browsers = ['PhantomJS', 'Chrome_travis_ci'];
28+
configuration.browsers = ['Chrome_travis_ci'];
2929
}
3030

3131
karma.set(configuration);

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Mock http requests made using fetch (or isomorphic-fetch)",
55
"main": "server.js",
66
"scripts": {
7-
"test": "make test coverage"
7+
"test": "make test"
88
},
99
"repository": {
1010
"type": "git",
@@ -25,10 +25,10 @@
2525
"homepage": "https://github.com/wheresrhys/fetch-mock",
2626
"dependencies": {
2727
"node-fetch": "^1.2.0",
28-
"sinon": "^1.14.1",
2928
"debug": "^2.2.0"
3029
},
3130
"devDependencies": {
31+
"babelify": "^6.3.0",
3232
"browserify": "^10.0.0",
3333
"chai": "^2.3.0",
3434
"coveralls": "^2.11.2",
@@ -39,9 +39,9 @@
3939
"karma-chai": "^0.1.0",
4040
"karma-chrome-launcher": "^0.1.8",
4141
"karma-mocha": "^0.1.10",
42-
"karma-phantomjs-launcher": "^0.1.4",
4342
"mocha": "^2.2.4",
4443
"mocha-lcov-reporter": "0.0.2",
45-
"npm-prepublish": "^1.2.0"
44+
"npm-prepublish": "^1.2.0",
45+
"sinon": "^1.17.0"
4646
}
4747
}

server.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
'use strict';
22

3-
var Response = require('node-fetch').Response;
4-
var Headers = require('node-fetch').Headers;
5-
var stream = require('stream');
6-
var FetchMock = require('./src/fetch-mock');
3+
const Response = require('node-fetch').Response;
4+
const Headers = require('node-fetch').Headers;
5+
const stream = require('stream');
6+
const FetchMock = require('./src/fetch-mock');
77

88
module.exports = new FetchMock({
99
theGlobal: GLOBAL,
1010
Response: Response,
1111
Headers: Headers,
12-
stream: stream
12+
stream: stream,
13+
debug: require('debug')('fetch-mock')
1314
});

0 commit comments

Comments
 (0)