Skip to content

Commit

Permalink
Merge ebe1f77 into 3b854ad
Browse files Browse the repository at this point in the history
  • Loading branch information
tbhartman authored Apr 24, 2020
2 parents 3b854ad + ebe1f77 commit d012a9f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ function Karma (socket, iframe, opener, navigator, location, document) {
socket.on('connect', function () {
socket.io.engine.on('upgrade', function () {
resultsBufferLimit = 1
// Flush any results which were buffered before the upgrade to WebSocket protocol.
if (resultsBuffer.length > 0) {
socket.emit('result', resultsBuffer)
resultsBuffer = []
}
})
var info = {
name: navigator.userAgent,
Expand Down
26 changes: 26 additions & 0 deletions test/e2e/reporting.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Feature: Results reporting
In order to use Karma
As a person who wants to write great tests
I want to Karma to report test results in the same order as they are executed.

Scenario: Results appear as tests are executed
Given a configuration with:
"""
files = ['reporting/test.js'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-mocha',
'karma-mocha-reporter',
'karma-chrome-launcher'
];
frameworks = ['mocha']
reporters = ['mocha']
"""
When I start Karma
Then it passes with like:
"""
START:
Reporting order
✔ sync test
✔ async test
"""
9 changes: 9 additions & 0 deletions test/e2e/support/reporting/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe('Reporting order', () => {
it('sync test', () => {
// pass
})

it('async test', (done) => {
setTimeout(done, 200)
})
})

0 comments on commit d012a9f

Please sign in to comment.