Skip to content

Commit 45c2da7

Browse files
Karine Pirescharlierudolph
authored andcommitted
Fix browser example
closes #448
1 parent c195c0f commit 45c2da7

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

example/example.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,12 @@
3939
case 'StepResult':
4040
var result;
4141
var stepResult = event.getPayloadItem('stepResult');
42-
if (stepResult.isSuccessful()) {
43-
result = {status: 'passed'};
44-
} else if (stepResult.isPending()) {
45-
result = {status: 'pending'};
46-
} else if (stepResult.isUndefined() || stepResult.isSkipped()) {
47-
result = {status:'skipped'};
48-
} else {
42+
if (stepResult.getStatus() === Cucumber.Status.FAILED) {
4943
var error = stepResult.getFailureException();
5044
var errorMessage = error.stack || error;
5145
result = {status: 'failed', error_message: errorMessage};
46+
} else {
47+
result = {status: stepResult.getStatus()};
5248
}
5349
formatter.match({uri:'report.feature', step: {line: currentStep.getLine()}});
5450
formatter.result(result);

example/index.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ <h2>Step definitions</h2>
3737
<textarea id="step-definitions">///// Your World /////
3838

3939
// Provide a custom World constructor. It's optional, a default one is supplied.
40-
this.World = function(callback) {
41-
callback();
42-
};
40+
this.World = function() {};
4341

4442
// Define your World!
4543

0 commit comments

Comments
 (0)