s9tpepper/karma-cucumberjs — pull request #1 by ReactiveRaven (2013-07-30 02:21:33+00:00)
Title: Adding settings-comments for allowPending

This may be entirely against your philosophy for the project, but I added a method to add overrides to allow for treating pending steps as non-failures in Karma.

Starting a comment on an otherwise empty line with "#karma-cucumberjs" would be treated as a space-delimited array of settings. Currently only 'allowPending' is implemented. The comment can be indented. There could be multiple comments per file.

eg, allowing pending steps from an entire feature:

```gherkin
#karma-cucumberjs allowPending
Feature: Some Feature
Scenario: Some scenario
Given a pending step
Scenario: Another scenario
Given a pending step
```
```
....
2 steps (2 pending)
Executed 2 of 2 (skipped 2) SUCCESS
```

eg, allowing pending steps only on a specific scenario:

```gherkin
Feature: Some Feature
Scenario: Some scenario
#karma-cucumberjs allowPending
Given a pending step
Scenario: Another scenario
Given a pending step
```
```
....
2 steps (2 pending)
Executed 2 of 2 (1 FAILED) (skipped 20)
```

It does this by adding a function `parseSettingsFromFeature` to the cucumber_runner which is called while loading feature files, passing the settings found into karma_listener's constructor, and adding the function `shouldAcceptPending` and updating the `checkStepSuccess` function in karma_listener.

The plugin is really useful already, I just decided to have a hack for fun, so please do close the pull request if you don't think this will be useful for you. Thanks :)