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.
fix(files): Ignore included:false pattern
Do not include a file, when `include=false`. Give `include=false` precedence over `include=true`. Closes karma-runner#1530
- Loading branch information
Showing
5 changed files
with
95 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Feature: Including files | ||
In order to use Karma | ||
As a person who wants to write great tests | ||
I want to be able to include and exclude files | ||
|
||
Scenario: Execute a test excluding a file | ||
Given a configuration with: | ||
""" | ||
files = [ | ||
{pattern: 'files/log_foo.js', included: false}, | ||
'files/*.js' | ||
]; | ||
browsers = ['PhantomJS']; | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-phantomjs-launcher' | ||
]; | ||
""" | ||
When I start Karma | ||
Then it passes with: | ||
""" | ||
. | ||
PhantomJS | ||
""" | ||
|
||
Scenario: Execute a test excluding an explicitly included file | ||
Given a configuration with: | ||
""" | ||
files = [ | ||
{pattern: 'files/log_foo.js', included: false}, | ||
{pattern: 'files/log_foo.js', included: true}, | ||
'files/*.js' | ||
]; | ||
browsers = ['PhantomJS']; | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-phantomjs-launcher' | ||
]; | ||
""" | ||
When I start Karma | ||
Then it passes with: | ||
""" | ||
. | ||
PhantomJS | ||
""" | ||
|
||
Scenario: Execute a test excluding an explicitly included file in another order | ||
Given a configuration with: | ||
""" | ||
files = [ | ||
'files/*.js', | ||
{pattern: 'files/log_foo.js', included: false}, | ||
{pattern: 'files/log_foo.js', included: true} | ||
]; | ||
browsers = ['PhantomJS']; | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-phantomjs-launcher' | ||
]; | ||
""" | ||
When I start Karma | ||
Then it passes with: | ||
""" | ||
. | ||
PhantomJS | ||
""" |
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,2 @@ | ||
|
||
console.log('foo') |
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,5 @@ | ||
describe('plus', function () { | ||
it('should pass', function () { | ||
expect(true).toBe(true) | ||
}) | ||
}) |