-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: POC - Add BrowserStack config files (#783)
- Loading branch information
Showing
5 changed files
with
114 additions
and
27 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
74 changes: 74 additions & 0 deletions
74
test/cross-browser-testing/browserstack/browserstack.karma.config.js
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 @@ | ||
const { DEBUG } = process.env; | ||
|
||
const files = [ | ||
'../../lib/mockhttprequest.js', | ||
'../../lib/geomock.js', | ||
'../../../node_modules/fetch-mock/dist/es5/client-bundle.js', | ||
'../../../node_modules/sinon-browser-only/sinon.js', | ||
'../../config.js', | ||
'../../../dist/mparticle.js', | ||
'../../test-bundle.js' | ||
]; | ||
|
||
const singleRun = true; | ||
|
||
let captureConsole = false; | ||
let browserConsoleLogOptions = {}; | ||
|
||
// Allows console logs to appear when doing npm run test:debug | ||
if (DEBUG === 'true') { | ||
browserConsoleLogOptions = { | ||
level: 'log', | ||
format: '%b %T: %m', | ||
terminal: true, | ||
}; | ||
captureConsole = true; | ||
} else { | ||
browserConsoleLogOptions = { | ||
terminal: false, | ||
}; | ||
} | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
browserStack: { | ||
username: process.env.BS_USERNAME, | ||
accessKey: process.env.BS_ACCESS_KEY | ||
}, | ||
// define browsers | ||
customLaunchers: { | ||
// Firefox 21 fails non-es6 tests | ||
bs_firefox_mac_21: { | ||
base: 'BrowserStack', | ||
browser: 'firefox', | ||
browser_version: '21.0', | ||
os: 'OS X', | ||
os_version: 'Snow Leopard' | ||
}, | ||
bs_firefox_mac_100: { | ||
base: 'BrowserStack', | ||
browser: 'firefox', | ||
browser_version: '100.0', | ||
os: 'OS X', | ||
os_version: 'Ventura' | ||
} | ||
}, | ||
browsers: ['bs_firefox_mac_21', 'bs_firefox_mac_100'], | ||
frameworks: ['mocha', 'should'], | ||
files, | ||
reporters: ['progress', 'junit'], | ||
colors: true, | ||
concurrency: Infinity, | ||
singleRun, | ||
debug: true, | ||
logLevel: config.LOG_INFO, | ||
browserConsoleLogOptions, | ||
client: { | ||
captureConsole, | ||
}, | ||
junitReporter: { | ||
outputDir: 'reports/', | ||
outputFile: 'test-karma.xml', | ||
}, | ||
}); | ||
}; |
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,8 @@ | ||
describe('test browserstack integration', function() { | ||
it('should pass', function() { | ||
true.should.equal(true); | ||
}); | ||
it('should not pass on older browsers', function() { | ||
'foo-bar'.replaceAll('o', 0).should.equal('f00-bar'); | ||
}); | ||
}); |
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