2019-11-24 19:13:37 +09:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
module.exports = function(config) {
|
|
|
|
config.set({
|
2020-11-16 21:20:35 -05:00
|
|
|
basePath: "./output/karma",
|
2019-11-24 19:13:37 +09:00
|
|
|
frameworks: [ 'mocha' ],
|
|
|
|
files: [
|
2020-11-16 21:20:35 -05:00
|
|
|
{ pattern: "./ethers.esm.js", type: "module" },
|
|
|
|
{ pattern: "./tests.esm.js", type: "module" }
|
2019-11-24 19:13:37 +09:00
|
|
|
],
|
2020-09-21 22:44:37 -04:00
|
|
|
reporters: [ 'karma' ],
|
2019-08-19 11:53:58 -04:00
|
|
|
plugins: [
|
|
|
|
'karma-mocha',
|
|
|
|
'karma-chrome-launcher',
|
|
|
|
require('./packages/tests/karma-reporter')
|
|
|
|
],
|
2019-11-24 19:13:37 +09:00
|
|
|
port: 9876,
|
|
|
|
logLevel: config.LOG_INFO,
|
2020-07-18 03:58:19 -04:00
|
|
|
browsers: [ 'ChromeHeadless', "HeadlessLittleLiar" ],
|
2019-11-24 19:13:37 +09:00
|
|
|
autoWatch: false,
|
|
|
|
singleRun: true,
|
2020-09-21 22:44:37 -04:00
|
|
|
browserNoActivityTimeout: 3600000,
|
2020-07-18 03:58:19 -04:00
|
|
|
customLaunchers: {
|
|
|
|
HeadlessLittleLiar: {
|
|
|
|
base: 'ChromeHeadless',
|
2020-07-19 01:19:38 -04:00
|
|
|
// https://peter.sh/experiments/chromium-command-line-switches/
|
2020-07-18 03:58:19 -04:00
|
|
|
flags: [
|
|
|
|
'--disable-extensions',
|
|
|
|
|
|
|
|
// Enable this to help debug CORS issues (otherwise fetch throws a useless TypeError)
|
|
|
|
//'--disable-web-security',
|
|
|
|
|
|
|
|
'--enable-automation',
|
|
|
|
|
|
|
|
// Cloudflare will block (on the testnet endpoints) any traffic
|
|
|
|
// from a headless chome (based on the user agent), so we lie
|
|
|
|
// This was take from Safari, because that is what I had on-hand
|
2021-05-19 01:30:12 -04:00
|
|
|
'--user-agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15',
|
|
|
|
|
|
|
|
// https://stackoverflow.com/questions/58484124/karma-disconnectedreconnect-failed-before-timeout-of-with-chromeheadless
|
|
|
|
'--disable-gpu',
|
|
|
|
'--no-sandbox'
|
|
|
|
],
|
2020-07-18 03:58:19 -04:00
|
|
|
}
|
|
|
|
},
|
2019-11-24 19:13:37 +09:00
|
|
|
/*
|
|
|
|
client: {
|
|
|
|
mocha: {
|
|
|
|
grep: 'utf',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
})
|
|
|
|
}
|