-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Travis + SauceLabs + Karma setup (first pass)
- add sauce connect - prepare to use karma on saucelabs; fix potential windows problems - rewrite `scripts/ensure-compatible-npm.sh` in JS - detect travis node 0.8 env; just upgrade if found - symlink `mocha` to itself for `karma-mocha` - if explicit `--production` flag is present, skip this - don't know how to skip this part if `mocha` is a devDep of some other package - use phantomjs@1.9.19; don't try to install npm@3 - browser tests with karma & phantom - move `support/browser-entry.js` to `browser-entry.js` to keep paths sane - `karma.conf.js` loads data out of `.karma.conf.js` - we have a "main" browser suite - then we have suites for each interface - each suite is a single run of Karma - each suite is executed by the `Makefile` - build `./mocha.js` upon test execution for `karma-mocha` to use - bonus: 3rd-party browserification should theoretically now be possible as per the `./index.js` entry in `package.json`'s `browser` field - add dev deps for karma - test changes: - split `lookupFiles` test into its own file so we can ignore it in Karma - fix broken `test/acceptance/throw.js` for browser - fix `test/acceptance/utils.js`'s `type` tests for PhantomJS - try to reduce build matrix - fix missing targets - fix infinite loop in Makefile - downgrade phantomjs to 1.9.8 - remove some cruft from karma config; try to add sauce labs - try again w/ the saucelabs - typo - remove karma-source-map-support as it's a no-go on IE8 - Require up-to-date mocha.js for any browser tests - Make CI rebuild mocha.js. Make won't rebuild when just checked out by CI because timestamps on source and mocha.js are the same. We could use a script to set the timestamps to the commit time, but it still wouldn't work if mocha.js were committed along with other changes that hadn't been built into it. Which shouldn't happen anyway -- but then again, the point of CI is to see what commits change, it's usually going to need to rebuild mocha.js if it's working right, so it's not going to hurt much to rebuild it every time even on the few times it doesn't need to.
- Loading branch information
Showing
17 changed files
with
321 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* eslint-env browser */ | ||
|
||
window.mocha.timeout(200) | ||
.ui('bdd'); |
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,4 @@ | ||
/* eslint-env browser */ | ||
|
||
window.mocha.timeout(200) | ||
.ui('exports'); |
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,4 @@ | ||
/* eslint-env browser */ | ||
|
||
window.mocha.timeout(200) | ||
.ui('qunit'); |
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,4 @@ | ||
/* eslint-env browser */ | ||
|
||
window.mocha.timeout(200) | ||
.ui('tdd'); |
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,4 @@ | ||
/* eslint-env browser */ | ||
|
||
window.mocha.timeout(200) | ||
.ui('bdd'); |
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,74 @@ | ||
function getConfig() { | ||
var cfg = { | ||
frameworks: [ | ||
'browserify', | ||
'should', | ||
'mocha' | ||
], | ||
files: [ | ||
'./.karma-config/fixture.js', | ||
'test/acceptance/*.js' | ||
], | ||
exclude: [ | ||
'test/acceptance/http.js', | ||
'test/acceptance/fs.js', | ||
'test/acceptance/lookup-files.js', | ||
'test/acceptance/require/**/*.js', | ||
'test/acceptance/misc/**/*.js' | ||
], | ||
preprocessors: { | ||
'test/**/*.js': ['browserify'] | ||
}, | ||
browserify: { | ||
debug: true, | ||
configure: function configure(b) { | ||
b.ignore('glob') | ||
.ignore('jade') | ||
.ignore('supports-color') | ||
.exclude('./lib-cov/mocha'); | ||
} | ||
}, | ||
reporters: ['mocha-clean'], | ||
port: 9876, | ||
colors: true, | ||
autoWatch: false, | ||
browsers: ['PhantomJS'], | ||
singleRun: true, | ||
concurrency: Infinity | ||
}; | ||
|
||
if (process.env.TRAVIS) { | ||
cfg.reporters.push('saucelabs'); | ||
cfg.browsers.push('ie8'); | ||
cfg.customLaunchers = { | ||
ie8: { | ||
base: 'SauceLabs', | ||
browserName: 'internet explorer', | ||
platform: 'Windows XP', | ||
version: '8.0' | ||
} | ||
}; | ||
cfg.sauceLabs = { | ||
testName: 'Karma Tests', | ||
build: 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' | ||
+ process.env.TRAVIS_BUILD_ID + ')', | ||
public: 'public', | ||
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER, | ||
startConnect: false | ||
}; | ||
// Debug logging into a file, that we print out at the end of the build. | ||
cfg.logLevel = 'DEBUG'; | ||
cfg.browserNoActivityTimeout = 120000; | ||
cfg.captureTimeout = 0; | ||
} | ||
return cfg; | ||
} | ||
|
||
getConfig.uiFixturePaths = { | ||
bdd: './.karma-config/fixture-bdd.js', | ||
tdd: './.karma-config/fixture-tdd.js', | ||
exports: './.karma-config/fixture-exports.js', | ||
qunit: './.karma-config/fixture-qunit.js' | ||
}; | ||
|
||
module.exports = getConfig; |
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
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,14 @@ | ||
var getConfig = require('./.karma-config'); | ||
|
||
module.exports = function(config) { | ||
var cfg = getConfig(); | ||
var ui = process.env.KARMA_INTERFACE; | ||
if (ui) { | ||
cfg.files = [ | ||
getConfig.uiFixturePaths[ui], | ||
'./test/acceptance/interfaces/' + ui + '.js' | ||
]; | ||
} | ||
|
||
config.set(cfg); | ||
}; |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.