-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(config): Add configuration for adding javascript version. #1983
Merged
dignifiedquire
merged 1 commit into
karma-runner:master
from
delftswa2016:feature-javascript-version-tag
Mar 21, 2016
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* eslint-disable no-unused-vars */ | ||
var isFirefox = function () { | ||
return typeof InstallTrigger !== 'undefined' | ||
} | ||
|
||
var containsJsTag = function () { | ||
var scripts = document.getElementsByTagName('script') | ||
for (var i = 0; i < scripts.length; i++) { | ||
if (scripts[i].type.indexOf(';version=') > -1) { | ||
return true | ||
} | ||
} | ||
return false | ||
} |
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,6 @@ | ||
/* globals containsJsTag, isFirefox */ | ||
describe('JavaScript version tag', function () { | ||
it('should add the version tag, if Firefox is used', function () { | ||
expect(containsJsTag()).toBe(isFirefox()) | ||
}) | ||
}) |
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,6 @@ | ||
/* globals containsJsTag */ | ||
describe('JavaScript version tag', function () { | ||
it('should not add the version tag for every browser', function () { | ||
expect(containsJsTag()).toBe(false) | ||
}) | ||
}) |
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,75 @@ | ||
Feature: JavaScript Tag | ||
In order to use Karma | ||
As a person who wants to write great tests | ||
I want to add a JavaScript version tag in Firefox only. | ||
|
||
Scenario: Execute a test in Firefox with version, with JavaScript tag | ||
Given a configuration with: | ||
""" | ||
files = ['tag/tag.js', 'tag/test-with-version.js']; | ||
browsers = ['Firefox'] | ||
jsVersion = 1.8 | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-firefox-launcher' | ||
] | ||
""" | ||
When I start Karma | ||
Then it passes with: | ||
""" | ||
. | ||
Firefox | ||
""" | ||
@not-jenkins | ||
Scenario: Execute a test in Chrome with version, without JavaScript tag | ||
Given a configuration with: | ||
""" | ||
files = ['tag/tag.js', 'tag/test-with-version.js']; | ||
browsers = ['Chrome']; | ||
jsVersion = 1.8; | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-chrome-launcher' | ||
]; | ||
""" | ||
When I start Karma | ||
Then it passes with: | ||
""" | ||
. | ||
Chrome | ||
""" | ||
|
||
Scenario: Execute a test in Firefox without version, without JavaScript tag | ||
Given a configuration with: | ||
""" | ||
files = ['tag/tag.js', 'tag/test-without-version.js']; | ||
browsers = ['Firefox'] | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-firefox-launcher' | ||
] | ||
""" | ||
When I start Karma | ||
Then it passes with: | ||
""" | ||
. | ||
Firefox | ||
""" | ||
@not-jenkins | ||
Scenario: Execute a test in Chrome without version, without JavaScript tag | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs the tag as well |
||
Given a configuration with: | ||
""" | ||
files = ['tag/tag.js', 'tag/test-without-version.js']; | ||
browsers = ['Chrome']; | ||
plugins = [ | ||
'karma-jasmine', | ||
'karma-chrome-launcher' | ||
]; | ||
""" | ||
When I start Karma | ||
Then it passes with: | ||
""" | ||
. | ||
Chrome | ||
""" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be tagged with
@not-jenkins
so it's not run on travis