diff --git a/README.md b/README.md index 43fb4e5..580bc5a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ ========= Sample for using karma-browserstack-launcher to run Karma tests (QUnit framework) on BrowserStack infrastructure. -One test is failing on purpose as a demo of BrowserStack catching bugs in different browsers. ### Prerequisites Node and npm @@ -32,11 +31,3 @@ You can further customize configuration in karma.conf.js. For detailed reference Execute the following command to run the karma tests: `npm test` - -###Note -- IE 6 and 7 Tests on Karma version 0.13 may fail(output - browser not captured). -- Use Karmav0.12 or below and add `transports: ['websocket','jsonp-polling']` to the karma.conf.js file -- Checkout [karma issue] for more details. - -[dashboard]:https://www.browserstack.com/automate -[karma issue]:https://github.com/karma-runner/karma/issues/983 diff --git a/karma.conf.js b/karma.conf.js index 2739be9..899c09d 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -37,7 +37,7 @@ module.exports = function(config) { // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], + reporters: ['progress', 'BrowserStack'], // web server port @@ -63,22 +63,24 @@ module.exports = function(config) { // define browsers customLaunchers: { - bs_firefox_mac: { + bs_chrome_windows: { base: 'BrowserStack', - browser: 'firefox', - browser_version: '21.0', - os: 'OS X', - os_version: 'Mountain Lion' + browser: 'chrome', + browser_version: '72.0', + os: 'Windows', + os_version: '10' }, - bs_iphone5: { + + bs_iphoneX: { base: 'BrowserStack', - device: 'iPhone 5', + device: 'iPhone X', os: 'ios', - os_version: '6.0' + real_mobile: true, + os_version: '11.0' } }, - browsers: ['bs_firefox_mac', 'bs_iphone5'], + browsers: ['bs_chrome_windows', 'bs_iphoneX'], // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher diff --git a/package.json b/package.json index db2e229..ee14119 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "karma-browserstack-example", - "version": "1.0.0", + "version": "2.0.0", "description": "Sample To test Karma with BrowserStack", "main": "karma.conf.js", "directories": { @@ -20,9 +20,9 @@ }, "homepage": "https://github.com/browserstack/karma-browserstack-example#readme", "dependencies": { - "karma": "^0.13.11", - "karma-browserstack-launcher": "^0.1.5", - "karma-qunit": "^0.1.5", - "qunitjs": "^1.19.0" + "karma": "^4.0.1", + "karma-browserstack-launcher": "^1.4.0", + "karma-qunit": "^3.0.0", + "qunit": "^2.9.2" } } diff --git a/tests/test.js b/tests/test.js index f96b5e8..fcb98b4 100644 --- a/tests/test.js +++ b/tests/test.js @@ -1,5 +1,7 @@ -test('isOdd()', function() { - ok(isOdd(1), 'One is an odd number'); - ok(isOdd(3), 'Three is an odd number'); - ok(isOdd(0), 'Zero is not odd number'); +QUnit.test("is 1 odd", function( assert ) { + assert.ok(isOdd(1), 'One is an odd number'); }); + +QUnit.test("is 2 odd", function( assert ) { + assert.notOk(isOdd(2), 'two is an even number'); +}); \ No newline at end of file