aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/karma.conf.js
diff options
context:
space:
mode:
authorrmacklin <1863540+rmacklin@users.noreply.github.com>2018-11-26 14:16:02 -0800
committerJavan Makhmali <javan@javan.us>2018-11-26 17:16:02 -0500
commit85b080365313437f646070ca214fef433c06db6a (patch)
treea2df565070129cef9f5064b565229a1a9ad96be5 /actioncable/karma.conf.js
parent38b676181b7cce5191b1877ad6781c490d38436d (diff)
downloadrails-85b080365313437f646070ca214fef433c06db6a.tar.gz
rails-85b080365313437f646070ca214fef433c06db6a.tar.bz2
rails-85b080365313437f646070ca214fef433c06db6a.zip
Convert ActionCable tests from CoffeeScript to ES2015 and replace Blade with Karma and Rollup (#34440)
* Rename .coffee files in ActionCable test suite in prep for decaffeination * Decaffeinate ActionCable tests * Replace Blade with Karma and Rollup to run ActionCable JS tests - Add karma and qunit devDependencies - Add test script to ActionCable package - Use rollup to bundle ActionCable tests - Use karma as the ActionCable JS test runner * Replace vendored mock-socket with package devDependency in ActionCable * Move ActionCable yarn install to TravisCI before_install config * Clean up decaffeinated ActionCable tests to use consistent formatting
Diffstat (limited to 'actioncable/karma.conf.js')
-rw-r--r--actioncable/karma.conf.js64
1 files changed, 64 insertions, 0 deletions
diff --git a/actioncable/karma.conf.js b/actioncable/karma.conf.js
new file mode 100644
index 0000000000..845b38d74f
--- /dev/null
+++ b/actioncable/karma.conf.js
@@ -0,0 +1,64 @@
+const config = {
+ browsers: ["ChromeHeadless"],
+ frameworks: ["qunit"],
+ files: [
+ "test/javascript/compiled/test.js",
+ ],
+
+ client: {
+ clearContext: false,
+ qunit: {
+ showUI: true
+ }
+ },
+
+ singleRun: true,
+ autoWatch: false,
+
+ captureTimeout: 180000,
+ browserDisconnectTimeout: 180000,
+ browserDisconnectTolerance: 3,
+ browserNoActivityTimeout: 300000,
+}
+
+if (process.env.CI) {
+ config.customLaunchers = {
+ sl_chrome: sauce("chrome", 70),
+ sl_ff: sauce("firefox", 63),
+ sl_safari: sauce("safari", 12.0, "macOS 10.13"),
+ sl_edge: sauce("microsoftedge", 17.17134, "Windows 10"),
+ sl_ie_11: sauce("internet explorer", 11, "Windows 8.1"),
+ }
+
+ config.browsers = Object.keys(config.customLaunchers)
+ config.reporters = ["dots", "saucelabs"]
+
+ config.sauceLabs = {
+ testName: "ActionCable JS Client",
+ retryLimit: 3,
+ build: buildId(),
+ }
+
+ function sauce(browserName, version, platform) {
+ const options = {
+ base: "SauceLabs",
+ browserName: browserName.toString(),
+ version: version.toString(),
+ }
+ if (platform) {
+ options.platform = platform.toString()
+ }
+ return options
+ }
+
+ function buildId() {
+ const { TRAVIS_BUILD_NUMBER, TRAVIS_BUILD_ID } = process.env
+ return TRAVIS_BUILD_NUMBER && TRAVIS_BUILD_ID
+ ? `TRAVIS #${TRAVIS_BUILD_NUMBER} (${TRAVIS_BUILD_ID})`
+ : ""
+ }
+}
+
+module.exports = function(karmaConfig) {
+ karmaConfig.set(config)
+}