-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Define specificity of patterns. Let most specific pattern decide to include files or not. Closes #1530
- Loading branch information
Showing
8 changed files
with
338 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
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: true}, | ||
{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 in another order | ||
Given a configuration with: | ||
""" | ||
files = [ | ||
'files/*.js', | ||
{pattern: 'files/log_foo.js', included: true}, | ||
{pattern: 'files/log_foo.js', included: false} | ||
]; | ||
browsers = ['PhantomJS']; | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-phantomjs-launcher' | ||
]; | ||
""" | ||
When I start Karma | ||
Then it passes with: | ||
""" | ||
. | ||
PhantomJS | ||
""" | ||
|
||
Scenario: Execute a test excluding an file included with brackets patterns | ||
Given a configuration with: | ||
""" | ||
files = [ | ||
'files/test.js', | ||
{pattern: 'files/log_foo.js', included: false}, | ||
{pattern: 'files/{log,bug}_foo.js', included: true} | ||
]; | ||
browsers = ['PhantomJS']; | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-phantomjs-launcher' | ||
]; | ||
""" | ||
When I start Karma | ||
Then it passes with: | ||
""" | ||
. | ||
PhantomJS | ||
""" | ||
|
||
Scenario: Execute a test excluding an file included with wildcard | ||
Given a configuration with: | ||
""" | ||
files = [ | ||
'files/test.js', | ||
{pattern: 'files/+(log|bug)_foo.js', included: false}, | ||
{pattern: 'files/*.js', included: true} | ||
]; | ||
browsers = ['PhantomJS']; | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-phantomjs-launcher' | ||
]; | ||
""" | ||
When I start Karma | ||
Then it passes with: | ||
""" | ||
. | ||
PhantomJS | ||
""" | ||
|
||
Scenario: Execute a test excluding an file included with glob-star | ||
Given a configuration with: | ||
""" | ||
files = [ | ||
'files/test.js', | ||
{pattern: 'files/*.js', included: false}, | ||
{pattern: 'files/**', included: true} | ||
]; | ||
browsers = ['PhantomJS']; | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-phantomjs-launcher' | ||
]; | ||
""" | ||
When I start Karma | ||
Then it passes with: | ||
""" | ||
. | ||
PhantomJS | ||
""" | ||
|
||
|
||
Scenario: Execute a test excluding an file included with ext. glob patterns | ||
Given a configuration with: | ||
""" | ||
files = [ | ||
'files/test.js', | ||
{pattern: 'files/+(log|bug)_foo.js', included: false}, | ||
{pattern: 'files/{log,bug}_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) | ||
}) | ||
}) |
Oops, something went wrong.