This repository has been archived by the owner on Jul 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb6a061
commit 1f62e4b
Showing
13 changed files
with
1,143 additions
and
2 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 |
---|---|---|
@@ -1,5 +1,22 @@ | ||
--- | ||
git: | ||
depth: 1 | ||
language: node_js | ||
node_js: | ||
- 0.10 | ||
- 0.11 | ||
before_install: | ||
- export CHROME_BIN=chromium-browser | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
- npm update -g | ||
- npm install -g karma-cli grunt-cli | ||
script: | ||
- grunt | ||
- npm test | ||
- npm run test:browsers -- --polyfill | ||
|
||
after_script: | ||
- npm run test:browsers -- --saucelabs | ||
- npm run test:browsers -- --saucelabs --ie8 | ||
- npm run test:browsers:perf |
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,31 @@ | ||
module.exports = function (config) { | ||
|
||
config.set({ | ||
basePath: '', | ||
frameworks: ['benchmark'], | ||
files: [ | ||
'dist/es6-module-loader.src.js', | ||
'test/perf.js' | ||
], | ||
reporters: ['benchmark'], | ||
browsers: ['Chrome', 'Firefox'], | ||
|
||
browserDisconnectTimeout: 10000, | ||
browserDisconnectTolerance: 2, | ||
browserNoActivityTimeout: 30000, | ||
captureTimeout: 120000 | ||
}); | ||
|
||
if(process.env.TRAVIS){ | ||
config.set({ | ||
customLaunchers: { | ||
'TR_Chrome': { | ||
base: 'Chrome', | ||
flags: ['--no-sandbox'] | ||
} | ||
}, | ||
browsers: ['TR_Chrome', 'Firefox'] | ||
}); | ||
} | ||
|
||
}; |
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,135 @@ | ||
'use strict'; | ||
|
||
var util = require('util'); | ||
var pkg = require('./package.json'); | ||
var extend = util._extend; | ||
var geSaLaKaCuLa = require('gesalakacula'); | ||
|
||
// No Karma options are passed after the double dash option (`--`) | ||
// Example : karma start --single-run -- --polyfill | ||
// >> { _: [], polyfill: true } | ||
|
||
var _argv = process.argv; | ||
var argv = require('minimist')(_argv.slice(_argv.indexOf('--') + 1)); | ||
|
||
|
||
var options = extend({ | ||
travis: process.env.TRAVIS, | ||
polyfill: false, | ||
saucelabs: false, | ||
ie8: false | ||
}, argv); | ||
|
||
if (options.ie8){ | ||
console.log('IE8 Mode !\n - polyfill required\n'); | ||
options.polyfill = true; | ||
} | ||
|
||
//// | ||
|
||
module.exports = function (config) { | ||
|
||
var files = [ | ||
'test/_helper.js', | ||
[!options.ie8 ? 'node_modules/traceur/bin/traceur.js' : ''], | ||
|
||
'dist/es6-module-loader' + | ||
(options.polyfill ? '' : '-sans-promises') | ||
+ '.src.js', | ||
|
||
'test/_browser.js', | ||
'test/custom-loader.js', | ||
|
||
[!options.ie8 ? 'test/*.spec.js' : 'test/*.normalize.spec.js'], | ||
|
||
{pattern: 'test/{loader,loads,syntax,worker}/**/*', included: false}, | ||
{pattern: 'node_modules/when/es6-shim/Promise.js', included: false}, | ||
{pattern: 'dist/es6-module-loader.js', included: false} | ||
]; | ||
|
||
// Default Config | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['mocha', 'expect'], | ||
files: flatten(files), | ||
reporters: ['mocha'], | ||
browsers: ['Chrome', 'Firefox'] | ||
}); | ||
|
||
if (options.travis) { | ||
// TRAVIS config overwrite | ||
config.set({ | ||
singleRun: true, | ||
reporters: ['dots'], | ||
customLaunchers: { | ||
'TR_Chrome': { | ||
base: 'Chrome', | ||
flags: ['--no-sandbox'] | ||
} | ||
}, | ||
browsers: ['TR_Chrome', 'Firefox'] | ||
}); | ||
} | ||
|
||
if (options.saucelabs) { | ||
|
||
var customLaunchers = geSaLaKaCuLa({ | ||
'Windows 7': { | ||
'internet explorer': '9..11' | ||
} | ||
}); | ||
|
||
if (options.ie8) { | ||
customLaunchers = geSaLaKaCuLa({ | ||
'Windows 7': { | ||
'internet explorer': '8' | ||
} | ||
}); | ||
} | ||
|
||
var now = new Date(); | ||
var buildData = options.travis ? | ||
{ | ||
location: 'TRAVIS', | ||
name: process.env.TRAVIS_BUILD_NUMBER, | ||
id: process.env.TRAVIS_BUILD_ID | ||
} | ||
: | ||
{ | ||
location: 'LOCAL', | ||
name: now.toString(), | ||
id: +now | ||
}; | ||
var build = util.format('%s #%s (%s)', | ||
buildData.location, buildData.name, buildData.id); | ||
|
||
console.log('SauceLabs Run\n- Build : ' + build + '\n'); | ||
|
||
config.set({ | ||
reporters: ['dots', 'saucelabs'], | ||
|
||
browserDisconnectTimeout: 10000, | ||
browserDisconnectTolerance: 2, | ||
browserNoActivityTimeout: 30000, | ||
captureTimeout: 120000, | ||
|
||
browsers: Object.keys(customLaunchers), | ||
sauceLabs: { | ||
testName: pkg.name, | ||
recordScreenshots: false, | ||
build: build, | ||
tunnelIdentifier: options.travis ? | ||
process.env.TRAVIS_JOB_NUMBER : Math.floor(Math.random() * 1000) | ||
}, | ||
customLaunchers: customLaunchers | ||
}); | ||
|
||
|
||
} | ||
}; | ||
|
||
function flatten(arr) { | ||
return arr.reduce(function (memo, val) { | ||
return memo.concat(util.isArray(val) ? flatten(val) : val ? [val] : []); | ||
}, []); | ||
} |
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,3 @@ | ||
|
||
// Change base url to the karma "base" | ||
System.baseURL += 'base/'; |
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,21 @@ | ||
|
||
|
||
(function (__global){ | ||
'use strict'; | ||
|
||
/** | ||
* Describe a block if the bool is true. | ||
* Will skip it otherwise. | ||
* @param bool | ||
* @returns {Function} describe or describe.skip | ||
*/ | ||
function describeIf(bool) { | ||
return (bool ? describe : describe.skip) | ||
.apply(null, Array.prototype.slice.call(arguments, 1)); | ||
} | ||
|
||
__global.describeIf = describeIf; | ||
|
||
}(typeof window != 'undefined' ? window : global)); | ||
|
||
|
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,12 @@ | ||
'use strict'; | ||
|
||
global.expect = require('expect.js'); | ||
|
||
require('./_helper'); | ||
|
||
require('../lib'); | ||
|
||
require('./system.spec'); | ||
|
||
require('./custom-loader'); | ||
require('./custom-loader.spec'); |
Oops, something went wrong.