Merge branch 'johnjbarton-noop-timer'

- Merges #1669 from @johnjbarton
This commit is contained in:
Gregg Van Hove
2019-03-13 17:33:33 -07:00
6 changed files with 23 additions and 32 deletions

View File

@@ -28,12 +28,6 @@ jasmineRequire.html = function(j$) {
};
jasmineRequire.HtmlReporter = function(j$) {
var noopTimer = {
start: function() {},
elapsed: function() { return 0; }
};
function ResultsStateBuilder() {
this.topResults = new j$.ResultsNode({}, '', null);
this.currentParent = this.topResults;
@@ -87,7 +81,7 @@ jasmineRequire.HtmlReporter = function(j$) {
navigateWithNewParam = options.navigateWithNewParam || function() {},
addToExistingQueryString = options.addToExistingQueryString || defaultQueryString,
filterSpecs = options.filterSpecs,
timer = options.timer || noopTimer,
timer = options.timer || j$.noopTimer,
htmlReporterMain,
symbols,
deprecationWarnings = [];

View File

@@ -63,7 +63,8 @@ var getJasmineRequireObj = (function (jasmineGlobal) {
j$.Expector = jRequire.Expector(j$);
j$.Expectation = jRequire.Expectation(j$);
j$.buildExpectationResult = jRequire.buildExpectationResult();
j$.JsApiReporter = jRequire.JsApiReporter();
j$.noopTimer = jRequire.noopTimer();
j$.JsApiReporter = jRequire.JsApiReporter(j$);
j$.matchersUtil = jRequire.matchersUtil(j$);
j$.ObjectContaining = jRequire.ObjectContaining(j$);
j$.ArrayContaining = jRequire.ArrayContaining(j$);
@@ -1738,13 +1739,7 @@ getJasmineRequireObj().Env = function(j$) {
return Env;
};
getJasmineRequireObj().JsApiReporter = function() {
var noopTimer = {
start: function(){},
elapsed: function(){ return 0; }
};
getJasmineRequireObj().JsApiReporter = function(j$) {
/**
* @name jsApiReporter
* @classdesc {@link Reporter} added by default in `boot.js` to record results for retrieval in javascript code. An instance is made available as `jsApiReporter` on the global object.
@@ -1752,7 +1747,7 @@ getJasmineRequireObj().JsApiReporter = function() {
* @hideconstructor
*/
function JsApiReporter(options) {
var timer = options.timer || noopTimer,
var timer = options.timer || j$.noopTimer,
status = 'loaded';
this.started = false;
@@ -6768,6 +6763,12 @@ getJasmineRequireObj().Timer = function() {
return Timer;
};
getJasmineRequireObj().noopTimer = function() {
return {
start: function() {},
elapsed: function() { return 0; }
};
};
getJasmineRequireObj().TreeProcessor = function() {
function TreeProcessor(attrs) {
var tree = attrs.tree,

View File

@@ -1,10 +1,4 @@
getJasmineRequireObj().JsApiReporter = function() {
var noopTimer = {
start: function(){},
elapsed: function(){ return 0; }
};
getJasmineRequireObj().JsApiReporter = function(j$) {
/**
* @name jsApiReporter
* @classdesc {@link Reporter} added by default in `boot.js` to record results for retrieval in javascript code. An instance is made available as `jsApiReporter` on the global object.
@@ -12,7 +6,7 @@ getJasmineRequireObj().JsApiReporter = function() {
* @hideconstructor
*/
function JsApiReporter(options) {
var timer = options.timer || noopTimer,
var timer = options.timer || j$.noopTimer,
status = 'loaded';
this.started = false;

View File

@@ -20,3 +20,10 @@ getJasmineRequireObj().Timer = function() {
return Timer;
};
getJasmineRequireObj().noopTimer = function() {
return {
start: function() {},
elapsed: function() { return 0; }
};
};

View File

@@ -41,7 +41,8 @@ var getJasmineRequireObj = (function (jasmineGlobal) {
j$.Expector = jRequire.Expector(j$);
j$.Expectation = jRequire.Expectation(j$);
j$.buildExpectationResult = jRequire.buildExpectationResult();
j$.JsApiReporter = jRequire.JsApiReporter();
j$.noopTimer = jRequire.noopTimer();
j$.JsApiReporter = jRequire.JsApiReporter(j$);
j$.matchersUtil = jRequire.matchersUtil(j$);
j$.ObjectContaining = jRequire.ObjectContaining(j$);
j$.ArrayContaining = jRequire.ArrayContaining(j$);

View File

@@ -1,10 +1,4 @@
jasmineRequire.HtmlReporter = function(j$) {
var noopTimer = {
start: function() {},
elapsed: function() { return 0; }
};
function ResultsStateBuilder() {
this.topResults = new j$.ResultsNode({}, '', null);
this.currentParent = this.topResults;
@@ -58,7 +52,7 @@ jasmineRequire.HtmlReporter = function(j$) {
navigateWithNewParam = options.navigateWithNewParam || function() {},
addToExistingQueryString = options.addToExistingQueryString || defaultQueryString,
filterSpecs = options.filterSpecs,
timer = options.timer || noopTimer,
timer = options.timer || j$.noopTimer,
htmlReporterMain,
symbols,
deprecationWarnings = [];