Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1308 from eiriksm/feat/browserify-tests
Add browser test to keep track of browserify compability.
- Loading branch information
Showing
4 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict' | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['tap'], | ||
files: [ | ||
'test-browser.js' | ||
], | ||
port: 9876, | ||
|
||
reporters: ['dots'], | ||
|
||
colors: true, | ||
|
||
logLevel: config.LOG_ERROR, | ||
|
||
autoWatch: false, | ||
|
||
browsers: ['PhantomJS'], | ||
|
||
singleRun: true | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict' | ||
|
||
if (!Function.prototype.bind) { | ||
// This is because of the fact that phantom.js does not have Function.bind. | ||
// This is a bug in phantom.js. | ||
// More info: https://github.com/ariya/phantomjs/issues/10522 | ||
/*eslint no-extend-native:0*/ | ||
Function.prototype.bind = require('function-bind') | ||
} | ||
|
||
|
||
var assert = require('assert') | ||
, tape = require('tape') | ||
, request = require('../../index') | ||
|
||
tape('Request browser test', function(t) { | ||
t.plan(1) | ||
request({ | ||
uri: 'https://api.github.com', | ||
withCredentials: false | ||
}, function (error, response) { | ||
t.equal(response.statusCode, 200) | ||
t.end() | ||
}) | ||
}) |