forked from karma-runner/karma
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Fail on launcher-, reporter-, plugin-, or preprocessor-load err…
…ors. Stop karma if a launcher, reporter, plugin, or preprocessor fails to load, after attempting to load each of them, and reporting errors for each load error. Closes karma-runner#855
- Loading branch information
Showing
8 changed files
with
198 additions
and
52 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
Feature: Basic Testrunner | ||
In order to use Karma | ||
As a person who wants to write great tests | ||
I want Karma to terminate upon misconfiguration | ||
|
||
Scenario: Execute with missing browser | ||
Given a configuration with: | ||
""" | ||
files = ['basic/plus.js', 'basic/test.js']; | ||
browsers = ['NonExistingBrowser', 'PhantomJS']; | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-phantomjs-launcher' | ||
]; | ||
singleRun = false | ||
""" | ||
When I start Karma | ||
Then it fails with like: | ||
""" | ||
Cannot load browser "NonExistingBrowser": it is not registered! Perhaps you are missing some plugin\? | ||
""" | ||
And it fails with like: | ||
""" | ||
Found 1 load error | ||
""" | ||
|
||
Scenario: Execute with missing plugin | ||
Given a configuration with: | ||
""" | ||
files = ['basic/plus.js', 'basic/test.js']; | ||
browsers = ['PhantomJS']; | ||
plugins = [ | ||
'karma-totally-non-existing-plugin', | ||
'karma-jasmine', | ||
'karma-phantomjs-launcher' | ||
]; | ||
singleRun = false | ||
""" | ||
When I start Karma | ||
Then it fails with like: | ||
""" | ||
Cannot find plugin "karma-totally-non-existing-plugin". | ||
[\s]+Did you forget to install it\? | ||
[\s]+npm install karma-totally-non-existing-plugin --save-dev | ||
""" | ||
And it fails with like: | ||
""" | ||
Found 1 load error | ||
""" | ||
|
||
Scenario: Execute with missing reporter | ||
Given a configuration with: | ||
""" | ||
files = ['basic/plus.js', 'basic/test.js']; | ||
browsers = ['PhantomJS']; | ||
reporters = ['unreal-reporter'] | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-phantomjs-launcher' | ||
]; | ||
singleRun = false | ||
""" | ||
When I start Karma | ||
Then it fails with like: | ||
""" | ||
Can not load reporter "unreal-reporter", it is not registered! | ||
[\s]+Perhaps you are missing some plugin\? | ||
""" | ||
And it fails with like: | ||
""" | ||
Found 1 load error | ||
""" | ||
|
||
Scenario: Execute with missing reporter, plugin and browser | ||
Given a configuration with: | ||
""" | ||
files = ['basic/plus.js', 'basic/test.js']; | ||
browsers = ['NonExistingBrowser', 'PhantomJS']; | ||
reporters = ['unreal-reporter'] | ||
plugins = [ | ||
'karma-totally-non-existing-plugin', | ||
'karma-jasmine', | ||
'karma-phantomjs-launcher' | ||
]; | ||
singleRun = false | ||
""" | ||
When I start Karma | ||
Then it fails with like: | ||
""" | ||
Can not load reporter "unreal-reporter", it is not registered! | ||
[\s]+Perhaps you are missing some plugin\? | ||
""" | ||
And it fails with like: | ||
""" | ||
Cannot find plugin "karma-totally-non-existing-plugin". | ||
[\s]+Did you forget to install it\? | ||
[\s]+npm install karma-totally-non-existing-plugin --save-dev | ||
""" | ||
And it fails with like: | ||
""" | ||
Cannot load browser "NonExistingBrowser": it is not registered! Perhaps you are missing some plugin\? | ||
""" | ||
And it fails with like: | ||
""" | ||
Found 3 load errors | ||
""" |
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
Oops, something went wrong.