-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(travis-ci): fix Webgl rendering test fails on Travis CI (#228)
* chore(travis): setting to test on travis ci * chore(karma): add mocha as default test env * chore(travis): set premultipliedAlpha = false * And apply refactoring & formatting Ref #225 Test Case * test(PanoImageRenderer): add webglcontextrestore test. Ref #228 Other * chore(package): add homepage * chore(package): update dev dependency as latest
- Loading branch information
Jongmoon Yoon
committed
Aug 14, 2018
1 parent
e404109
commit cb2e15f
Showing
10 changed files
with
15,601 additions
and
15,024 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 |
---|---|---|
@@ -1,80 +1,88 @@ | ||
module.exports = function(config) { | ||
var karmaConfig = { | ||
frameworks: ["mocha", "chai", "sinon"], | ||
module.exports = config => { | ||
const karmaConfig = { | ||
frameworks: ["mocha", "chai", "sinon"], | ||
|
||
browserNoActivityTimeout: 60000, | ||
browserNoActivityTimeout: 60000, | ||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
"./node_modules/resemblejs/resemble.js", | ||
"./node_modules/lite-fixture/index.js", | ||
// list of files / patterns to load in the browser | ||
files: [ | ||
"./node_modules/resemblejs/resemble.js", | ||
"./node_modules/lite-fixture/index.js", | ||
"./node_modules/hammer-simulator/index.js", | ||
"./test/hammer-simulator.run.js", | ||
"./test/unit/util.js", | ||
"./test/unit/**/*.spec.js", | ||
{pattern: "./test/manual/img/**/*.*", watched: false, included: false, served: true}, | ||
// {pattern: "./test/img/*.*", watched: false, included: false, served: true}, | ||
], | ||
"./test/unit/**/*.spec.js", | ||
{pattern: "./test/manual/img/**/*.*", watched: false, included: false, served: true}, | ||
// {pattern: "./test/img/*.*", watched: false, included: false, served: true}, | ||
], | ||
|
||
proxies: { | ||
"/images/": "/base/test/manual/img/" | ||
"/images/": "/base/test/manual/img/" | ||
}, | ||
|
||
client: { | ||
mocha: { | ||
opts: "./mocha.opts", | ||
timeout: "20000" | ||
} | ||
}, | ||
client: { | ||
mocha: { | ||
opts: "./mocha.opts", | ||
timeout: "20000" | ||
} | ||
}, | ||
|
||
webpack: { | ||
webpack: { | ||
devtool: "inline-source-map", | ||
mode: "none", | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: "babel-loader", | ||
} | ||
] | ||
} | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: "babel-loader", | ||
} | ||
] | ||
} | ||
}, | ||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
"./test/**/*.spec.js": config.coverage ? ["webpack"] : ["webpack", "sourcemap"] | ||
}, | ||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
"./test/**/*.spec.js": config.coverage ? ["webpack"] : ["webpack", "sourcemap"] | ||
}, | ||
|
||
browsers: [], | ||
customLaunchers: { | ||
ChromeHeadlessGL: { | ||
base: 'ChromeHeadless', | ||
flags: ['--disable-gpu', '--use-gl=osmesa'] | ||
} | ||
}, | ||
reporters: ["mocha"], | ||
webpackMiddleware: { | ||
noInfo: true | ||
} | ||
}; | ||
browsers: [], | ||
customLaunchers: { | ||
ChromeHeadlessGL: { | ||
base: "Chrome", | ||
flags: [ | ||
"--headless", | ||
"--hide-scrollbars", | ||
"--mute-audio", | ||
"--no-sandbox", | ||
"--disable-setuid-sandbox", | ||
// Without a remote debugging port, Google Chrome exits immediately. | ||
"--remote-debugging-port=9222", | ||
// Although --use-gl=osmesa is not specified. it need to install libosmesa in TRAVIS setting to test sucessfully | ||
] | ||
} | ||
}, | ||
reporters: ["mocha"], | ||
webpackMiddleware: { | ||
noInfo: true | ||
} | ||
}; | ||
|
||
karmaConfig.browsers.push(config.chrome ? "Chrome" : "ChromeHeadlessGL"); | ||
karmaConfig.browsers.push(config.chrome ? "Chrome" : "ChromeHeadlessGL"); | ||
|
||
if(config.coverage) { | ||
karmaConfig.reporters.push("coverage-istanbul"); | ||
karmaConfig.coverageIstanbulReporter = { | ||
reports: ["text-summary", "html", "lcovonly"], | ||
dir: "./coverage" | ||
}; | ||
karmaConfig.webpack.module.rules.unshift({ | ||
test: /\.js$/, | ||
exclude: /(node_modules|test)/, | ||
loader: "istanbul-instrumenter-loader" | ||
}); | ||
karmaConfig.singleRun = true; | ||
} | ||
if (config.coverage) { | ||
karmaConfig.reporters.push("coverage-istanbul"); | ||
karmaConfig.coverageIstanbulReporter = { | ||
reports: ["text-summary", "html", "lcovonly"], | ||
dir: "./coverage" | ||
}; | ||
karmaConfig.webpack.module.rules.unshift({ | ||
test: /\.js$/, | ||
exclude: /(node_modules|test)/, | ||
loader: "istanbul-instrumenter-loader" | ||
}); | ||
karmaConfig.singleRun = true; | ||
} | ||
|
||
config.set(karmaConfig); | ||
config.set(karmaConfig); | ||
}; |
Oops, something went wrong.