Move knowledge of query parameters out of boot1.js
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
describe('HtmlExactSpecFilter', function() {
|
||||
it('matches everything when no string is provided', function() {
|
||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
||||
filterString() {
|
||||
return '';
|
||||
queryString: {
|
||||
getParam(name) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,8 +13,12 @@ describe('HtmlExactSpecFilter', function() {
|
||||
|
||||
it('matches a spec with the exact same path', function() {
|
||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
||||
filterString() {
|
||||
return '["a","b","c"]';
|
||||
queryString: {
|
||||
getParam(name) {
|
||||
if (name === 'spec') {
|
||||
return '["a","b","c"]';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -21,8 +27,12 @@ describe('HtmlExactSpecFilter', function() {
|
||||
|
||||
it('matches a spec whose path has the filter path as a prefix', function() {
|
||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
||||
filterString() {
|
||||
return '["a","b"]';
|
||||
queryString: {
|
||||
getParam(name) {
|
||||
if (name === 'spec') {
|
||||
return '["a","b"]';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -31,8 +41,12 @@ describe('HtmlExactSpecFilter', function() {
|
||||
|
||||
it('does not match a spec with a different path', function() {
|
||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
||||
filterString() {
|
||||
return '["a","b","c"]';
|
||||
queryString: {
|
||||
getParam(name) {
|
||||
if (name === 'spec') {
|
||||
return '["a","b","c"]';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1368,6 +1368,11 @@ describe('HtmlReporter', function() {
|
||||
},
|
||||
createTextNode: function() {
|
||||
return document.createTextNode.apply(document, arguments);
|
||||
},
|
||||
queryString: {
|
||||
getParam(name) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
};
|
||||
specStatus = {
|
||||
@@ -1382,7 +1387,12 @@ describe('HtmlReporter', function() {
|
||||
|
||||
describe('when the specs are not filtered', function() {
|
||||
beforeEach(function() {
|
||||
reporterConfig.filterSpecs = false;
|
||||
reporterConfig.queryString.getParam = function(name) {
|
||||
if (name !== 'spec') {
|
||||
throw new Error('Unexpected query param ' + name);
|
||||
}
|
||||
return '';
|
||||
};
|
||||
reporter = new jasmineUnderTest.HtmlReporter(reporterConfig);
|
||||
reporter.initialize();
|
||||
reporter.jasmineStarted({ totalSpecsDefined: 1 });
|
||||
@@ -1400,7 +1410,12 @@ describe('HtmlReporter', function() {
|
||||
|
||||
describe('when the specs are filtered', function() {
|
||||
beforeEach(function() {
|
||||
reporterConfig.filterSpecs = true;
|
||||
reporterConfig.queryString.getParam = function(name) {
|
||||
if (name !== 'spec') {
|
||||
throw new Error('Unexpected query param ' + name);
|
||||
}
|
||||
return 'not the empty string';
|
||||
};
|
||||
reporter = new jasmineUnderTest.HtmlReporter(reporterConfig);
|
||||
reporter.initialize();
|
||||
reporter.jasmineStarted({ totalSpecsDefined: 1 });
|
||||
|
||||
Reference in New Issue
Block a user