Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d66d0d9d2e | |||
| f4b9c889b9 | |||
| 388d7fb1a2 | |||
| e993a4a363 | |||
| 54ac39a192 | |||
| ea882c2f1e | |||
| 4cc605756a | |||
| b6426d2414 | |||
| 2352249441 | |||
| 4dfc34a7a0 | |||
| 695a805844 | |||
| 10bc655622 | |||
| 4663280528 | |||
| 75347d9ba0 | |||
| 86387c9068 | |||
| 9b3cc08818 | |||
| 0ad54fc6f0 | |||
| c042665d9c | |||
| a457cf1b81 | |||
| fb814b5f94 | |||
| 77c3b8b07e | |||
| bd89ef66c8 | |||
| 01f050eeaa | |||
| de44e909f2 | |||
| 10ad40357a | |||
| 1f521f2a7f | |||
| 5b3e12e4c5 | |||
| 7ba53b25f7 | |||
| cfd8f11b30 | |||
| d95ebf303a | |||
| dbc1f9244e | |||
| 489b83c61b | |||
| b881b0077d | |||
| 67ef721c85 | |||
| c4abf3265d | |||
| 68a7cbb991 | |||
| 73a30ffc3e | |||
| 18491e9b84 | |||
| 0738ba6462 | |||
| 712f9bac29 | |||
| d99bc3ab58 | |||
| 418393c496 | |||
| 2a83f5cc30 | |||
| bca56032e0 | |||
| c590095662 |
@@ -22,6 +22,8 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note: Only available on Node.
|
* Note: Only available on Node.
|
||||||
* @module jasmine-core
|
* @module jasmine-core
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This file starts the process of "booting" Jasmine. It initializes Jasmine,
|
This file starts the process of "booting" Jasmine. It initializes Jasmine,
|
||||||
makes its globals available, and creates the env. This file should be loaded
|
makes its globals available, and creates the env. This file should be loaded
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This file finishes 'booting' Jasmine, performing all of the necessary
|
This file finishes 'booting' Jasmine, performing all of the necessary
|
||||||
initialization before executing the loaded environment and all of a project's
|
initialization before executing the loaded environment and all of a project's
|
||||||
@@ -37,55 +39,18 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
const env = jasmine.getEnv();
|
const env = jasmine.getEnv();
|
||||||
|
const urls = new jasmine.HtmlReporterV2Urls();
|
||||||
const queryString = new jasmine.QueryString({
|
|
||||||
getWindowLocation: function() {
|
|
||||||
return window.location;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const config = {
|
|
||||||
stopOnSpecFailure: queryString.getParam('stopOnSpecFailure'),
|
|
||||||
stopSpecOnExpectationFailure: queryString.getParam(
|
|
||||||
'stopSpecOnExpectationFailure'
|
|
||||||
),
|
|
||||||
hideDisabled: queryString.getParam('hideDisabled')
|
|
||||||
};
|
|
||||||
|
|
||||||
const random = queryString.getParam('random');
|
|
||||||
|
|
||||||
if (random !== undefined && random !== '') {
|
|
||||||
config.random = random;
|
|
||||||
}
|
|
||||||
|
|
||||||
const seed = queryString.getParam('seed');
|
|
||||||
if (seed) {
|
|
||||||
config.seed = seed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ## Reporters
|
* ## Reporters
|
||||||
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
|
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
|
||||||
*/
|
*/
|
||||||
const htmlReporter = new jasmine.HtmlReporter({
|
const htmlReporter = new jasmine.HtmlReporterV2({
|
||||||
env: env,
|
env,
|
||||||
navigateWithNewParam: function(key, value) {
|
urls,
|
||||||
return queryString.navigateWithNewParam(key, value);
|
getContainer() {
|
||||||
},
|
|
||||||
addToExistingQueryString: function(key, value) {
|
|
||||||
return queryString.fullStringWithNewParam(key, value);
|
|
||||||
},
|
|
||||||
getContainer: function() {
|
|
||||||
return document.body;
|
return document.body;
|
||||||
},
|
}
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
},
|
|
||||||
timer: new jasmine.Timer(),
|
|
||||||
queryString
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,16 +58,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
*/
|
*/
|
||||||
env.addReporter(jsApiReporter);
|
env.addReporter(jsApiReporter);
|
||||||
env.addReporter(htmlReporter);
|
env.addReporter(htmlReporter);
|
||||||
|
env.configure(urls.configFromCurrentUrl());
|
||||||
/**
|
|
||||||
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
|
|
||||||
*/
|
|
||||||
const specFilter = new jasmine.HtmlExactSpecFilter({ queryString });
|
|
||||||
config.specFilter = function(spec) {
|
|
||||||
return specFilter.matches(spec);
|
|
||||||
};
|
|
||||||
|
|
||||||
env.configure(config);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ## Execution
|
* ## Execution
|
||||||
|
|||||||
+1383
-827
File diff suppressed because it is too large
Load Diff
@@ -63,6 +63,7 @@ body {
|
|||||||
float: right;
|
float: right;
|
||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
padding-right: 9px;
|
padding-right: 9px;
|
||||||
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
.jasmine_html-reporter .jasmine-symbol-summary {
|
.jasmine_html-reporter .jasmine-symbol-summary {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -115,6 +116,23 @@ body {
|
|||||||
color: #ba9d37;
|
color: #ba9d37;
|
||||||
content: "•";
|
content: "•";
|
||||||
}
|
}
|
||||||
|
.jasmine_html-reporter progress {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.jasmine_html-reporter progress[value] {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
-moz-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
}
|
||||||
|
.jasmine_html-reporter progress[value]::-webkit-progress-value, .jasmine_html-reporter progress[value]::-moz-progress-bar {
|
||||||
|
background: #007069;
|
||||||
|
}
|
||||||
|
.failed .jasmine_html-reporter progress[value]::-webkit-progress-value, .failed .jasmine_html-reporter progress[value]::-moz-progress-bar {
|
||||||
|
background: #ca3a11;
|
||||||
|
}
|
||||||
|
.jasmine_html-reporter progress.failed[value]::-webkit-progress-value, .jasmine_html-reporter progress.failed[value]::-moz-progress-bar {
|
||||||
|
background: #ca3a11;
|
||||||
|
}
|
||||||
.jasmine_html-reporter .jasmine-run-options {
|
.jasmine_html-reporter .jasmine-run-options {
|
||||||
float: right;
|
float: right;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
@@ -145,8 +163,12 @@ body {
|
|||||||
display: block;
|
display: block;
|
||||||
color: #eee;
|
color: #eee;
|
||||||
}
|
}
|
||||||
|
.jasmine_html-reporter .jasmine-bar.jasmine-in-progress {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
.jasmine_html-reporter .jasmine-bar.jasmine-failed, .jasmine_html-reporter .jasmine-bar.jasmine-errored {
|
.jasmine_html-reporter .jasmine-bar.jasmine-failed, .jasmine_html-reporter .jasmine-bar.jasmine-errored {
|
||||||
background-color: #ca3a11;
|
background-color: #ca3a11;
|
||||||
|
color: #eee;
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
}
|
}
|
||||||
.jasmine_html-reporter .jasmine-bar.jasmine-passed {
|
.jasmine_html-reporter .jasmine-bar.jasmine-passed {
|
||||||
|
|||||||
+436
-189
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jasmine-core",
|
"name": "jasmine-core",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "6.0.0-alpha.0",
|
"version": "6.0.0-alpha.1",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/jasmine/jasmine.git"
|
"url": "https://github.com/jasmine/jasmine.git"
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
"eslint-plugin-compat": "^6.0.2",
|
"eslint-plugin-compat": "^6.0.2",
|
||||||
"glob": "^10.2.3",
|
"glob": "^10.2.3",
|
||||||
"globals": "^16.0.0",
|
"globals": "^16.0.0",
|
||||||
"jasmine": "^5.0.0",
|
"jasmine": "github:jasmine/jasmine-npm#6.0",
|
||||||
"jasmine-browser-runner": "github:jasmine/jasmine-browser-runner#4.0",
|
"jasmine-browser-runner": "github:jasmine/jasmine-browser-runner#4.0",
|
||||||
"jsdom": "^26.0.0",
|
"jsdom": "^26.0.0",
|
||||||
"prettier": "1.17.1",
|
"prettier": "1.17.1",
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# Jasmine Core 5.12.0 Release Notes
|
||||||
|
|
||||||
|
This release reverts the exact spec filtering feature introduced in 5.11.0,
|
||||||
|
which broke spec filtering in Karma.
|
||||||
|
|
||||||
|
## Supported environments
|
||||||
|
|
||||||
|
This version has been tested in the following environments.
|
||||||
|
|
||||||
|
| Environment | Supported versions |
|
||||||
|
|-------------|--------------------------------|
|
||||||
|
| Node | 18.20.5**, 20, 22, 24 |
|
||||||
|
| Safari | 16**, 17** |
|
||||||
|
| Chrome | 141* |
|
||||||
|
| Firefox | 102**, 115**, 128**, 140, 143* |
|
||||||
|
| Edge | 140* |
|
||||||
|
|
||||||
|
\* Evergreen browser. Each version of Jasmine is tested against the latest
|
||||||
|
version available at release time.<br>
|
||||||
|
\** Supported on a best-effort basis. Support for these versions may be dropped
|
||||||
|
if it becomes impractical, and bugs affecting only these versions may not be
|
||||||
|
treated as release blockers.
|
||||||
|
|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
|
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
# Jasmine Core 6.0.0-alpha.1 Release Notes
|
||||||
|
|
||||||
|
This is a pre-release, intended to offer a preview of breaking changes and to
|
||||||
|
solicit feedback.
|
||||||
|
|
||||||
|
## A Note About Pre-Release Compatibility
|
||||||
|
|
||||||
|
There may be additional breaking changes in future 6.0 pre-releases or in the
|
||||||
|
final 6.0 release. That's allowed by the semver specification, but users are
|
||||||
|
sometimes unpleasantly surprised by it.
|
||||||
|
|
||||||
|
NPM's implementation of carat version ranges assumes that subsequent
|
||||||
|
pre-releases and final releases are fully compatible with earlier pre-releases.
|
||||||
|
If your package.json contains `"jasmine-core": "^6.0.0-alpha.1`,
|
||||||
|
NPM might install any later 6.x version even though there is no guarantee of
|
||||||
|
compatibility. If that isn't ok, you should specify an exact pre-release version:
|
||||||
|
`"jasmine-core": "6.0.0-alpha.1`.
|
||||||
|
|
||||||
|
|
||||||
|
## Breaking changes
|
||||||
|
|
||||||
|
### Changes that affect reporters
|
||||||
|
|
||||||
|
* Irrelevant properties such as `status` and `failedExpectations` are omitted
|
||||||
|
from [the event passed to suiteStarted](https://jasmine.github.io/api/6.0.0-alpha.1/global.html#SuiteStartedEvent).
|
||||||
|
|
||||||
|
This change should be compatible with most existing reporters but could break
|
||||||
|
reporters that manage their internal state in unusual ways. Please
|
||||||
|
[open an issue](https://github.com/jasmine/jasmine/issues/new?template=bug_report.yml)
|
||||||
|
if you find a published reporter package that works with jasmine-core 5.x but
|
||||||
|
not with this release.
|
||||||
|
|
||||||
|
### Changes that affect browser boot files
|
||||||
|
|
||||||
|
* The `createElement` and `createTextNode` options of `HtmlReporter` are ignored.
|
||||||
|
`HtmlReporter` now unconditionally uses `document.createElement` and
|
||||||
|
`document.createTextNode`.
|
||||||
|
|
||||||
|
### Changes that affect spec writing
|
||||||
|
|
||||||
|
* HTML reporters cache configuration throughout each run. Configuration changes
|
||||||
|
made while specs are running will not affect reporter behavior.
|
||||||
|
* Global error spies always receive a single argument. Previously, the browser
|
||||||
|
error event was passed as the second argument.
|
||||||
|
|
||||||
|
## New features
|
||||||
|
|
||||||
|
* A new `HtmlReporterV2` with several improvements over the old `HtmlReporter`:
|
||||||
|
* Clicking a spec/suite link does exact filtering rather than a substring
|
||||||
|
match.
|
||||||
|
* The old dots are replaced with a progress bar. This improves usability with
|
||||||
|
large suites and fixes an accessibility problem.
|
||||||
|
* Details of failed specs are displayed as soon as each spec finishes.
|
||||||
|
* Initialization and wire-up in boot files are much simpler.
|
||||||
|
|
||||||
|
If you're using jasmine-browser-runner or copying boot1.js from the standalone
|
||||||
|
distribution, you'll automatically get the new reporter. If you maintain your
|
||||||
|
own boot files, you'll get the old reporter unless you update your boot1.js
|
||||||
|
to match the one that's in this package.
|
||||||
|
|
||||||
|
The new reporter produces `spec` query string parameters that are different
|
||||||
|
from those created by the old reporter. If you use non-Jasmine software that
|
||||||
|
interprets the `spec` parameter, such as karma-jasmine, you may not be able to
|
||||||
|
adopt `HtmlReporterV2` unlesss it's updated.
|
||||||
|
* Use `globalThis` to determine the global object during initialization
|
||||||
|
This makes jasmine-core more tolerant of buggy bundlers or loaders that
|
||||||
|
cause `this` to be undefined in the global context.
|
||||||
|
|
||||||
|
|
||||||
|
## Deprecations
|
||||||
|
|
||||||
|
* Warn if jasmine-core is loaded as an ES module in a browser.
|
||||||
|
This is an untested and unsupported configuration that has been known to cause
|
||||||
|
problems in the past.
|
||||||
|
* Deprecated `HtmlReporter` and `HtmlSpecFilter` in favor of `HtmlReporterV2`.
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation improvements
|
||||||
|
|
||||||
|
* Improved API reference documentation for APIs that are used from browser boot
|
||||||
|
files.
|
||||||
|
|
||||||
|
|
||||||
|
## Internal improvements
|
||||||
|
|
||||||
|
* Removed remaining code that supported suite re-entry.
|
||||||
|
* Encapsulated suite and spec result and status management.
|
||||||
|
* Adopted strict mode throughout the codebase.
|
||||||
|
* Decomposed `HtmlReporter` into components and converted to ES6 classes.
|
||||||
|
* Made global error handling more uniform between browsers and Node.
|
||||||
|
|
||||||
|
|
||||||
|
## Supported environments
|
||||||
|
|
||||||
|
This version has been tested in the following environments.
|
||||||
|
|
||||||
|
| Environment | Supported versions |
|
||||||
|
|-------------------|--------------------------------|
|
||||||
|
| Node | 20, 22, 24 |
|
||||||
|
| Safari | 16**, 17** |
|
||||||
|
| Chrome | 141* |
|
||||||
|
| Firefox | 102**, 115**, 128**, 140, 143* |
|
||||||
|
| Edge | 141* |
|
||||||
|
|
||||||
|
\* Evergreen browser. Each version of Jasmine is tested against the latest
|
||||||
|
version available at release time.<br>
|
||||||
|
\** Supported on a best-effort basis. Support for these versions may be dropped
|
||||||
|
if it becomes impractical, and bugs affecting only these versions may not be
|
||||||
|
treated as release blockers.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
|
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||||
@@ -13,10 +13,7 @@ describe('GlobalErrors', function() {
|
|||||||
const error = new Error('nope');
|
const error = new Error('nope');
|
||||||
dispatchEvent(globals.listeners, 'error', { error });
|
dispatchEvent(globals.listeners, 'error', { error });
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(
|
expect(handler).toHaveBeenCalledWith(jasmine.is(error));
|
||||||
jasmine.is(error),
|
|
||||||
jasmine.objectContaining({ error: jasmine.is(error) })
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('is not affected by overriding global.onerror', function() {
|
it('is not affected by overriding global.onerror', function() {
|
||||||
@@ -35,10 +32,7 @@ describe('GlobalErrors', function() {
|
|||||||
const error = new Error('nope');
|
const error = new Error('nope');
|
||||||
dispatchEvent(globals.listeners, 'error', { error });
|
dispatchEvent(globals.listeners, 'error', { error });
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(
|
expect(handler).toHaveBeenCalledWith(jasmine.is(error));
|
||||||
jasmine.is(error),
|
|
||||||
jasmine.objectContaining({ error: jasmine.is(error) })
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('only calls the most recent handler', function() {
|
it('only calls the most recent handler', function() {
|
||||||
@@ -58,10 +52,7 @@ describe('GlobalErrors', function() {
|
|||||||
dispatchEvent(globals.listeners, 'error', { error });
|
dispatchEvent(globals.listeners, 'error', { error });
|
||||||
|
|
||||||
expect(handler1).not.toHaveBeenCalled();
|
expect(handler1).not.toHaveBeenCalled();
|
||||||
expect(handler2).toHaveBeenCalledWith(
|
expect(handler2).toHaveBeenCalledWith(jasmine.is(error));
|
||||||
jasmine.is(error),
|
|
||||||
jasmine.objectContaining({ error: jasmine.is(error) })
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('calls previous handlers when one is removed', function() {
|
it('calls previous handlers when one is removed', function() {
|
||||||
@@ -82,10 +73,7 @@ describe('GlobalErrors', function() {
|
|||||||
const error = new Error('nope');
|
const error = new Error('nope');
|
||||||
dispatchEvent(globals.listeners, 'error', { error });
|
dispatchEvent(globals.listeners, 'error', { error });
|
||||||
|
|
||||||
expect(handler1).toHaveBeenCalledWith(
|
expect(handler1).toHaveBeenCalledWith(jasmine.is(error));
|
||||||
jasmine.is(error),
|
|
||||||
jasmine.objectContaining({ error: jasmine.is(error) })
|
|
||||||
);
|
|
||||||
expect(handler2).not.toHaveBeenCalled();
|
expect(handler2).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -130,6 +118,32 @@ describe('GlobalErrors', function() {
|
|||||||
errors.uninstall();
|
errors.uninstall();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("reports browser error events that don't have errors", function() {
|
||||||
|
const globals = browserGlobals();
|
||||||
|
const handler = jasmine.createSpy('errorHandler');
|
||||||
|
const errors = new privateUnderTest.GlobalErrors(
|
||||||
|
globals.global,
|
||||||
|
() => ({})
|
||||||
|
);
|
||||||
|
errors.install();
|
||||||
|
errors.pushListener(handler);
|
||||||
|
|
||||||
|
const event = {
|
||||||
|
message: 'Uncaught SyntaxError: Unexpected end of input',
|
||||||
|
error: undefined,
|
||||||
|
filename: 'borkenSpec.js',
|
||||||
|
lineno: 42
|
||||||
|
};
|
||||||
|
dispatchEvent(globals.listeners, 'error', event);
|
||||||
|
|
||||||
|
expect(handler).toHaveBeenCalledWith({
|
||||||
|
message: 'Uncaught SyntaxError: Unexpected end of input',
|
||||||
|
filename: 'borkenSpec.js',
|
||||||
|
lineno: 42,
|
||||||
|
stack: '@borkenSpec.js:42'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('reports uncaught exceptions in node.js', function() {
|
it('reports uncaught exceptions in node.js', function() {
|
||||||
const globals = nodeGlobals();
|
const globals = nodeGlobals();
|
||||||
const errors = new privateUnderTest.GlobalErrors(
|
const errors = new privateUnderTest.GlobalErrors(
|
||||||
@@ -152,7 +166,7 @@ describe('GlobalErrors', function() {
|
|||||||
|
|
||||||
dispatchEvent(globals.listeners, 'uncaughtException', new Error('bar'));
|
dispatchEvent(globals.listeners, 'uncaughtException', new Error('bar'));
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(new Error('bar'), undefined);
|
expect(handler).toHaveBeenCalledWith(new Error('bar'));
|
||||||
expect(handler.calls.argsFor(0)[0].jasmineMessage).toBe(
|
expect(handler.calls.argsFor(0)[0].jasmineMessage).toBe(
|
||||||
'Uncaught exception: Error: bar'
|
'Uncaught exception: Error: bar'
|
||||||
);
|
);
|
||||||
@@ -185,7 +199,7 @@ describe('GlobalErrors', function() {
|
|||||||
|
|
||||||
dispatchEvent(globals.listeners, 'unhandledRejection', new Error('bar'));
|
dispatchEvent(globals.listeners, 'unhandledRejection', new Error('bar'));
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(new Error('bar'), undefined);
|
expect(handler).toHaveBeenCalledWith(new Error('bar'));
|
||||||
expect(handler.calls.argsFor(0)[0].jasmineMessage).toBe(
|
expect(handler.calls.argsFor(0)[0].jasmineMessage).toBe(
|
||||||
'Unhandled promise rejection: Error: bar'
|
'Unhandled promise rejection: Error: bar'
|
||||||
);
|
);
|
||||||
@@ -213,8 +227,7 @@ describe('GlobalErrors', function() {
|
|||||||
'Unhandled promise rejection: 17\n' +
|
'Unhandled promise rejection: 17\n' +
|
||||||
'(Tip: to get a useful stack trace, use ' +
|
'(Tip: to get a useful stack trace, use ' +
|
||||||
'Promise.reject(new Error(...)) instead of Promise.reject(...).)'
|
'Promise.reject(new Error(...)) instead of Promise.reject(...).)'
|
||||||
),
|
)
|
||||||
undefined
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -236,8 +249,7 @@ describe('GlobalErrors', function() {
|
|||||||
'Unhandled promise rejection with no error or message\n' +
|
'Unhandled promise rejection with no error or message\n' +
|
||||||
'(Tip: to get a useful stack trace, use ' +
|
'(Tip: to get a useful stack trace, use ' +
|
||||||
'Promise.reject(new Error(...)) instead of Promise.reject().)'
|
'Promise.reject(new Error(...)) instead of Promise.reject().)'
|
||||||
),
|
)
|
||||||
undefined
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -281,7 +293,7 @@ describe('GlobalErrors', function() {
|
|||||||
undefined
|
undefined
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(new Error('nope'), undefined);
|
expect(handler).toHaveBeenCalledWith(new Error('nope'));
|
||||||
expect(handler.calls.argsFor(0)[0].jasmineMessage).toBe(
|
expect(handler.calls.argsFor(0)[0].jasmineMessage).toBe(
|
||||||
'Unhandled promise rejection: Error: nope'
|
'Unhandled promise rejection: Error: nope'
|
||||||
);
|
);
|
||||||
@@ -324,7 +336,7 @@ describe('GlobalErrors', function() {
|
|||||||
);
|
);
|
||||||
errors.reportUnhandledRejections();
|
errors.reportUnhandledRejections();
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(new Error('nope'), undefined);
|
expect(handler).toHaveBeenCalledWith(new Error('nope'));
|
||||||
expect(handler.calls.argsFor(0)[0].jasmineMessage).toBe(
|
expect(handler.calls.argsFor(0)[0].jasmineMessage).toBe(
|
||||||
'Unhandled promise rejection: Error: nope'
|
'Unhandled promise rejection: Error: nope'
|
||||||
);
|
);
|
||||||
@@ -407,10 +419,7 @@ describe('GlobalErrors', function() {
|
|||||||
const event = { reason: 'nope' };
|
const event = { reason: 'nope' };
|
||||||
dispatchEvent(globals.listeners, 'unhandledrejection', event);
|
dispatchEvent(globals.listeners, 'unhandledrejection', event);
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(
|
expect(handler).toHaveBeenCalledWith('Unhandled promise rejection: nope');
|
||||||
'Unhandled promise rejection: nope',
|
|
||||||
event
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('reports rejections whose reason is an Error', function() {
|
it('reports rejections whose reason is an Error', function() {
|
||||||
@@ -428,13 +437,15 @@ describe('GlobalErrors', function() {
|
|||||||
const event = { reason };
|
const event = { reason };
|
||||||
dispatchEvent(globals.listeners, 'unhandledrejection', event);
|
dispatchEvent(globals.listeners, 'unhandledrejection', event);
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(
|
expect(handler).toHaveBeenCalledTimes(1);
|
||||||
|
const received = handler.calls.argsFor(0)[0];
|
||||||
|
expect(received).toBeInstanceOf(Error);
|
||||||
|
expect(received).toEqual(
|
||||||
jasmine.objectContaining({
|
jasmine.objectContaining({
|
||||||
jasmineMessage: 'Unhandled promise rejection: Error: bar',
|
jasmineMessage: 'Unhandled promise rejection: Error: bar',
|
||||||
message: reason.message,
|
message: reason.message,
|
||||||
stack: reason.stack
|
stack: reason.stack
|
||||||
}),
|
})
|
||||||
event
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -469,8 +480,7 @@ describe('GlobalErrors', function() {
|
|||||||
dispatchEvent(globals.listeners, 'unhandledrejection', event);
|
dispatchEvent(globals.listeners, 'unhandledrejection', event);
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(
|
expect(handler).toHaveBeenCalledWith(
|
||||||
'Unhandled promise rejection: nope',
|
'Unhandled promise rejection: nope'
|
||||||
event
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -507,8 +517,7 @@ describe('GlobalErrors', function() {
|
|||||||
errors.reportUnhandledRejections();
|
errors.reportUnhandledRejections();
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(
|
expect(handler).toHaveBeenCalledWith(
|
||||||
'Unhandled promise rejection: nope',
|
'Unhandled promise rejection: nope'
|
||||||
{ reason: 'nope', promise }
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -567,10 +576,7 @@ describe('GlobalErrors', function() {
|
|||||||
|
|
||||||
dispatchEvent(globals.listeners, 'uncaughtException', 17);
|
dispatchEvent(globals.listeners, 'uncaughtException', 17);
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(
|
expect(handler).toHaveBeenCalledWith(new Error('Uncaught exception: 17'));
|
||||||
new Error('Uncaught exception: 17'),
|
|
||||||
undefined
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('substitutes a descriptive message when the error is falsy', function() {
|
it('substitutes a descriptive message when the error is falsy', function() {
|
||||||
@@ -587,8 +593,7 @@ describe('GlobalErrors', function() {
|
|||||||
dispatchEvent(globals.listeners, 'uncaughtException', undefined);
|
dispatchEvent(globals.listeners, 'uncaughtException', undefined);
|
||||||
|
|
||||||
expect(handler).toHaveBeenCalledWith(
|
expect(handler).toHaveBeenCalledWith(
|
||||||
new Error('Uncaught exception with no error or message'),
|
new Error('Uncaught exception with no error or message')
|
||||||
undefined
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -619,7 +624,7 @@ describe('GlobalErrors', function() {
|
|||||||
const event = { error: 'baz' };
|
const event = { error: 'baz' };
|
||||||
dispatchEvent(globals.listeners, 'error', event);
|
dispatchEvent(globals.listeners, 'error', event);
|
||||||
expect(overrideHandler).not.toHaveBeenCalledWith('baz');
|
expect(overrideHandler).not.toHaveBeenCalledWith('baz');
|
||||||
expect(handler1).toHaveBeenCalledWith('baz', event);
|
expect(handler1).toHaveBeenCalledWith('baz');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('overrides the existing handlers in Node until removed', function() {
|
it('overrides the existing handlers in Node until removed', function() {
|
||||||
@@ -648,7 +653,7 @@ describe('GlobalErrors', function() {
|
|||||||
|
|
||||||
dispatchEvent(globals.listeners, 'uncaughtException', new Error('bar'));
|
dispatchEvent(globals.listeners, 'uncaughtException', new Error('bar'));
|
||||||
expect(overrideHandler).not.toHaveBeenCalled();
|
expect(overrideHandler).not.toHaveBeenCalled();
|
||||||
expect(handler1).toHaveBeenCalledWith(new Error('bar'), undefined);
|
expect(handler1).toHaveBeenCalledWith(new Error('bar'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles unhandled promise rejections in browsers', function() {
|
it('handles unhandled promise rejections in browsers', function() {
|
||||||
|
|||||||
@@ -471,31 +471,6 @@ describe('QueueRunner', function() {
|
|||||||
expect(nextQueueableFn.fn).toHaveBeenCalled();
|
expect(nextQueueableFn.fn).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles a global error event with a message but no error', function() {
|
|
||||||
const queueableFn = {
|
|
||||||
fn: function(done) {
|
|
||||||
const currentHandler = globalErrors.pushListener.calls.mostRecent()
|
|
||||||
.args[0];
|
|
||||||
currentHandler(undefined, { message: 'nope' });
|
|
||||||
},
|
|
||||||
timeout: 1
|
|
||||||
};
|
|
||||||
const onException = jasmine.createSpy('onException');
|
|
||||||
const globalErrors = {
|
|
||||||
pushListener: jasmine.createSpy('pushListener'),
|
|
||||||
popListener: jasmine.createSpy('popListener')
|
|
||||||
};
|
|
||||||
const queueRunner = new privateUnderTest.QueueRunner({
|
|
||||||
queueableFns: [queueableFn],
|
|
||||||
onException: onException,
|
|
||||||
globalErrors: globalErrors
|
|
||||||
});
|
|
||||||
|
|
||||||
queueRunner.execute();
|
|
||||||
|
|
||||||
expect(onException).toHaveBeenCalledWith('nope');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('handles exceptions thrown while waiting for the stack to clear', function() {
|
it('handles exceptions thrown while waiting for the stack to clear', function() {
|
||||||
const queueableFn = {
|
const queueableFn = {
|
||||||
fn: function(done) {
|
fn: function(done) {
|
||||||
@@ -529,40 +504,6 @@ describe('QueueRunner', function() {
|
|||||||
clearStack.calls.argsFor(0)[0]();
|
clearStack.calls.argsFor(0)[0]();
|
||||||
expect(onException).toHaveBeenCalledWith(error);
|
expect(onException).toHaveBeenCalledWith(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles a global error event with no error while waiting for the stack to clear', function() {
|
|
||||||
const queueableFn = {
|
|
||||||
fn: function(done) {
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const errorListeners = [];
|
|
||||||
const globalErrors = {
|
|
||||||
pushListener: function(f) {
|
|
||||||
errorListeners.push(f);
|
|
||||||
},
|
|
||||||
popListener: function() {
|
|
||||||
errorListeners.pop();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const clearStack = jasmine.createSpy('clearStack');
|
|
||||||
const onException = jasmine.createSpy('onException');
|
|
||||||
const queueRunner = new privateUnderTest.QueueRunner({
|
|
||||||
queueableFns: [queueableFn],
|
|
||||||
globalErrors: globalErrors,
|
|
||||||
clearStack: clearStack,
|
|
||||||
onException: onException
|
|
||||||
});
|
|
||||||
|
|
||||||
queueRunner.execute();
|
|
||||||
jasmine.clock().tick();
|
|
||||||
expect(clearStack).toHaveBeenCalled();
|
|
||||||
expect(errorListeners.length).toEqual(1);
|
|
||||||
errorListeners[0](undefined, { message: 'nope' });
|
|
||||||
|
|
||||||
clearStack.calls.argsFor(0)[0]();
|
|
||||||
expect(onException).toHaveBeenCalledWith('nope');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('with a function that returns a promise', function() {
|
describe('with a function that returns a promise', function() {
|
||||||
|
|||||||
+20
-13
@@ -33,18 +33,15 @@ describe('Runner', function() {
|
|||||||
attrs = attrs || {};
|
attrs = attrs || {};
|
||||||
this.id = 'suite' + suiteNumber++;
|
this.id = 'suite' + suiteNumber++;
|
||||||
this.children = attrs.children || [];
|
this.children = attrs.children || [];
|
||||||
this.canBeReentered = function() {
|
|
||||||
return !attrs.noReenter;
|
|
||||||
};
|
|
||||||
this.markedPending = attrs.markedPending || false;
|
this.markedPending = attrs.markedPending || false;
|
||||||
this.sharedUserContext = function() {
|
this.sharedUserContext = function() {
|
||||||
return attrs.userContext || {};
|
return attrs.userContext || {};
|
||||||
};
|
};
|
||||||
this.result = {
|
this.startedEvent = jasmine.createSpy('startedEvent');
|
||||||
id: this.id,
|
this.doneEvent = jasmine.createSpy('doneEvent');
|
||||||
failedExpectations: []
|
this.hasOwnFailedExpectations = jasmine.createSpy(
|
||||||
};
|
'hasOwnFailedExpectations'
|
||||||
this.getResult = jasmine.createSpy('getResult');
|
);
|
||||||
this.beforeAllFns = attrs.beforeAllFns || [];
|
this.beforeAllFns = attrs.beforeAllFns || [];
|
||||||
this.afterAllFns = attrs.afterAllFns || [];
|
this.afterAllFns = attrs.afterAllFns || [];
|
||||||
this.cleanupBeforeAfter = function() {};
|
this.cleanupBeforeAfter = function() {};
|
||||||
@@ -130,6 +127,7 @@ describe('Runner', function() {
|
|||||||
children: [spec],
|
children: [spec],
|
||||||
userContext: { root: 'context' }
|
userContext: { root: 'context' }
|
||||||
});
|
});
|
||||||
|
topSuite.doneEvent.and.returnValue({});
|
||||||
detectLateRejectionHandling = true;
|
detectLateRejectionHandling = true;
|
||||||
const subject = makeRunner(topSuite);
|
const subject = makeRunner(topSuite);
|
||||||
|
|
||||||
@@ -157,6 +155,7 @@ describe('Runner', function() {
|
|||||||
children: [suite],
|
children: [suite],
|
||||||
userContext: { for: 'topSuite' }
|
userContext: { for: 'topSuite' }
|
||||||
});
|
});
|
||||||
|
topSuite.doneEvent.and.returnValue({});
|
||||||
suite.parentSuite = topSuite;
|
suite.parentSuite = topSuite;
|
||||||
const subject = makeRunner(topSuite);
|
const subject = makeRunner(topSuite);
|
||||||
|
|
||||||
@@ -185,10 +184,13 @@ describe('Runner', function() {
|
|||||||
SkipPolicy: privateUnderTest.SkipAfterBeforeAllErrorPolicy
|
SkipPolicy: privateUnderTest.SkipAfterBeforeAllErrorPolicy
|
||||||
});
|
});
|
||||||
|
|
||||||
|
suite.startedEvent.and.returnValue('suite started event');
|
||||||
runQueue.calls.mostRecent().args[0].queueableFns[0].fn('foo');
|
runQueue.calls.mostRecent().args[0].queueableFns[0].fn('foo');
|
||||||
expect(reportDispatcher.suiteStarted).toHaveBeenCalledWith(suite.result);
|
expect(reportDispatcher.suiteStarted).toHaveBeenCalledWith(
|
||||||
|
'suite started event'
|
||||||
|
);
|
||||||
|
|
||||||
suite.getResult.and.returnValue({ my: 'result' });
|
suite.doneEvent.and.returnValue({ my: 'result' });
|
||||||
|
|
||||||
runQueue.calls.mostRecent().args[0].onComplete();
|
runQueue.calls.mostRecent().args[0].onComplete();
|
||||||
expect(reportDispatcher.suiteDone).toHaveBeenCalledWith({ my: 'result' });
|
expect(reportDispatcher.suiteDone).toHaveBeenCalledWith({ my: 'result' });
|
||||||
@@ -236,14 +238,19 @@ describe('Runner', function() {
|
|||||||
queueableFns = runQueue.calls.mostRecent().args[0].queueableFns;
|
queueableFns = runQueue.calls.mostRecent().args[0].queueableFns;
|
||||||
expect(queueableFns.length).toBe(2);
|
expect(queueableFns.length).toBe(2);
|
||||||
|
|
||||||
|
parent.startedEvent.and.returnValue('parent suite started event');
|
||||||
queueableFns[0].fn();
|
queueableFns[0].fn();
|
||||||
expect(reportDispatcher.suiteStarted).toHaveBeenCalledWith(parent.result);
|
expect(reportDispatcher.suiteStarted).toHaveBeenCalledWith(
|
||||||
|
'parent suite started event'
|
||||||
|
);
|
||||||
|
|
||||||
verifyAndFinishSpec(spec, queueableFns[1], true);
|
verifyAndFinishSpec(spec, queueableFns[1], true);
|
||||||
|
|
||||||
parent.getResult.and.returnValue(parent.result);
|
parent.doneEvent.and.returnValue('parent suite done event');
|
||||||
runQueue.calls.argsFor(1)[0].onComplete();
|
runQueue.calls.argsFor(1)[0].onComplete();
|
||||||
expect(reportDispatcher.suiteDone).toHaveBeenCalledWith(parent.result);
|
expect(reportDispatcher.suiteDone).toHaveBeenCalledWith(
|
||||||
|
'parent suite done event'
|
||||||
|
);
|
||||||
await expectAsync(promise).toBePending();
|
await expectAsync(promise).toBePending();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+94
-21
@@ -85,7 +85,7 @@ describe('Spec', function() {
|
|||||||
|
|
||||||
spec.setSpecProperty('a', 4);
|
spec.setSpecProperty('a', 4);
|
||||||
|
|
||||||
expect(spec.result.properties).toEqual({ a: 4 });
|
expect(spec.doneEvent().properties).toEqual({ a: 4 });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('replace the property result when it was previously set', function() {
|
it('replace the property result when it was previously set', function() {
|
||||||
@@ -97,7 +97,7 @@ describe('Spec', function() {
|
|||||||
spec.setSpecProperty('b', 'original-value');
|
spec.setSpecProperty('b', 'original-value');
|
||||||
spec.setSpecProperty('a', 'new-value');
|
spec.setSpecProperty('a', 'new-value');
|
||||||
|
|
||||||
expect(spec.result.properties).toEqual({
|
expect(spec.doneEvent().properties).toEqual({
|
||||||
a: 'new-value',
|
a: 'new-value',
|
||||||
b: 'original-value'
|
b: 'original-value'
|
||||||
});
|
});
|
||||||
@@ -149,11 +149,16 @@ describe('Spec', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('status', function() {
|
describe('status', function() {
|
||||||
it('is "passed" by default', function() {
|
it('returns "passed" by default', function() {
|
||||||
const spec = new privateUnderTest.Spec({
|
const spec = new privateUnderTest.Spec({
|
||||||
queueableFn: { fn: () => {} }
|
queueableFn: { fn: () => {} }
|
||||||
});
|
});
|
||||||
expect(spec.getResult().status).toBe('passed');
|
expect(spec.status())
|
||||||
|
.withContext('status()')
|
||||||
|
.toBe('passed');
|
||||||
|
expect(spec.doneEvent().status)
|
||||||
|
.withContext('doneEvent().status')
|
||||||
|
.toBe('passed');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('is "passed" if all expectations passed', function() {
|
it('is "passed" if all expectations passed', function() {
|
||||||
@@ -163,7 +168,12 @@ describe('Spec', function() {
|
|||||||
|
|
||||||
spec.addExpectationResult(true, {});
|
spec.addExpectationResult(true, {});
|
||||||
|
|
||||||
expect(spec.getResult().status).toBe('passed');
|
expect(spec.status())
|
||||||
|
.withContext('status()')
|
||||||
|
.toBe('passed');
|
||||||
|
expect(spec.doneEvent().status)
|
||||||
|
.withContext('doneEvent().status')
|
||||||
|
.toBe('passed');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('is "failed" if any expectation failed', function() {
|
it('is "failed" if any expectation failed', function() {
|
||||||
@@ -174,7 +184,12 @@ describe('Spec', function() {
|
|||||||
spec.addExpectationResult(true, {});
|
spec.addExpectationResult(true, {});
|
||||||
spec.addExpectationResult(false, {});
|
spec.addExpectationResult(false, {});
|
||||||
|
|
||||||
expect(spec.getResult().status).toBe('failed');
|
expect(spec.status())
|
||||||
|
.withContext('status()')
|
||||||
|
.toBe('failed');
|
||||||
|
expect(spec.doneEvent().status)
|
||||||
|
.withContext('doneEvent().status')
|
||||||
|
.toBe('failed');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('is "pending" if created without a function body', function() {
|
it('is "pending" if created without a function body', function() {
|
||||||
@@ -186,7 +201,65 @@ describe('Spec', function() {
|
|||||||
resultCallback: resultCallback
|
resultCallback: resultCallback
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(spec.getResult().status).toBe('pending');
|
expect(spec.status())
|
||||||
|
.withContext('status()')
|
||||||
|
.toBe('pending');
|
||||||
|
expect(spec.doneEvent().status)
|
||||||
|
.withContext('doneEvent().status')
|
||||||
|
.toBe('pending');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('after a call to executionFinished()', function() {
|
||||||
|
describe('with excluded true', function() {
|
||||||
|
it("is 'excluded'", function() {
|
||||||
|
const spec = new privateUnderTest.Spec({
|
||||||
|
queueableFn: { fn: () => {} }
|
||||||
|
});
|
||||||
|
|
||||||
|
spec.executionFinished(true, false);
|
||||||
|
|
||||||
|
expect(spec.status())
|
||||||
|
.withContext('status()')
|
||||||
|
.toBe('excluded');
|
||||||
|
expect(spec.doneEvent().status)
|
||||||
|
.withContext('doneEvent().status')
|
||||||
|
.toBe('excluded');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('with failSpecWithNoExp true', function() {
|
||||||
|
it("is 'failed' if there were no expectations", function() {
|
||||||
|
const spec = new privateUnderTest.Spec({
|
||||||
|
queueableFn: { fn: () => {} }
|
||||||
|
});
|
||||||
|
|
||||||
|
spec.executionFinished(false, true);
|
||||||
|
|
||||||
|
expect(spec.status())
|
||||||
|
.withContext('status()')
|
||||||
|
.toBe('failed');
|
||||||
|
expect(spec.doneEvent().status)
|
||||||
|
.withContext('doneEvent().status')
|
||||||
|
.toBe('failed');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('after a call to hadBeforeAllFailure()', function() {
|
||||||
|
it("is 'failed'", function() {
|
||||||
|
const spec = new privateUnderTest.Spec({
|
||||||
|
queueableFn: { fn: () => {} }
|
||||||
|
});
|
||||||
|
|
||||||
|
spec.hadBeforeAllFailure();
|
||||||
|
|
||||||
|
expect(spec.status())
|
||||||
|
.withContext('status()')
|
||||||
|
.toBe('failed');
|
||||||
|
expect(spec.doneEvent().status)
|
||||||
|
.withContext('doneEvent().status')
|
||||||
|
.toBe('failed');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -199,10 +272,10 @@ describe('Spec', function() {
|
|||||||
spec.addExpectationResult(true, { message: 'expectation1' });
|
spec.addExpectationResult(true, { message: 'expectation1' });
|
||||||
spec.addExpectationResult(false, { message: 'expectation2' });
|
spec.addExpectationResult(false, { message: 'expectation2' });
|
||||||
|
|
||||||
expect(spec.result.passedExpectations).toEqual([
|
expect(spec.doneEvent().passedExpectations).toEqual([
|
||||||
jasmine.objectContaining({ message: 'expectation1' })
|
jasmine.objectContaining({ message: 'expectation1' })
|
||||||
]);
|
]);
|
||||||
expect(spec.result.failedExpectations).toEqual([
|
expect(spec.doneEvent().failedExpectations).toEqual([
|
||||||
jasmine.objectContaining({ message: 'expectation2' })
|
jasmine.objectContaining({ message: 'expectation2' })
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
@@ -219,7 +292,7 @@ describe('Spec', function() {
|
|||||||
spec.addExpectationResult(false, { message: 'failed' });
|
spec.addExpectationResult(false, { message: 'failed' });
|
||||||
}).toThrowError(jasmineUnderTest.private.errors.ExpectationFailed);
|
}).toThrowError(jasmineUnderTest.private.errors.ExpectationFailed);
|
||||||
|
|
||||||
expect(spec.result.failedExpectations).toEqual([
|
expect(spec.doneEvent().failedExpectations).toEqual([
|
||||||
jasmine.objectContaining({ message: 'failed' })
|
jasmine.objectContaining({ message: 'failed' })
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
@@ -233,7 +306,7 @@ describe('Spec', function() {
|
|||||||
|
|
||||||
spec.addExpectationResult(false, { message: 'failed' });
|
spec.addExpectationResult(false, { message: 'failed' });
|
||||||
|
|
||||||
expect(spec.result.failedExpectations).toEqual([
|
expect(spec.doneEvent().failedExpectations).toEqual([
|
||||||
jasmine.objectContaining({ message: 'failed' })
|
jasmine.objectContaining({ message: 'failed' })
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
@@ -262,7 +335,7 @@ describe('Spec', function() {
|
|||||||
message: jasmine.stringMatching(/^Error: nope/)
|
message: jasmine.stringMatching(/^Error: nope/)
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
expect(spec.result.failedExpectations).toEqual([]);
|
expect(spec.doneEvent().failedExpectations).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not forward non-late expectation failures to onLateError', function() {
|
it('does not forward non-late expectation failures to onLateError', function() {
|
||||||
@@ -299,7 +372,7 @@ describe('Spec', function() {
|
|||||||
message: jasmine.stringMatching(/^Error: oops/)
|
message: jasmine.stringMatching(/^Error: oops/)
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
expect(spec.result.failedExpectations).toEqual([]);
|
expect(spec.doneEvent().failedExpectations).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not forward non-late handleException calls to onLateError', function() {
|
it('does not forward non-late handleException calls to onLateError', function() {
|
||||||
@@ -313,7 +386,7 @@ describe('Spec', function() {
|
|||||||
spec.handleException(error);
|
spec.handleException(error);
|
||||||
|
|
||||||
expect(onLateError).not.toHaveBeenCalled();
|
expect(onLateError).not.toHaveBeenCalled();
|
||||||
expect(spec.result.failedExpectations.length).toEqual(1);
|
expect(spec.doneEvent().failedExpectations.length).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('clears the reportedDone flag when reset', function() {
|
it('clears the reportedDone flag when reset', function() {
|
||||||
@@ -376,7 +449,7 @@ describe('Spec', function() {
|
|||||||
|
|
||||||
spec.handleException('foo');
|
spec.handleException('foo');
|
||||||
|
|
||||||
expect(spec.result.failedExpectations).toEqual([
|
expect(spec.doneEvent().failedExpectations).toEqual([
|
||||||
{
|
{
|
||||||
message: 'foo thrown',
|
message: 'foo thrown',
|
||||||
matcherName: '',
|
matcherName: '',
|
||||||
@@ -396,7 +469,7 @@ describe('Spec', function() {
|
|||||||
new jasmineUnderTest.private.errors.ExpectationFailed()
|
new jasmineUnderTest.private.errors.ExpectationFailed()
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(spec.result.failedExpectations).toEqual([]);
|
expect(spec.doneEvent().failedExpectations).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -410,15 +483,15 @@ describe('Spec', function() {
|
|||||||
const t1 = 123;
|
const t1 = 123;
|
||||||
const t2 = 456;
|
const t2 = 456;
|
||||||
|
|
||||||
expect(spec.result.debugLogs).toBeNull();
|
expect(spec.doneEvent().debugLogs).toBeNull();
|
||||||
timer.elapsed.and.returnValue(t1);
|
timer.elapsed.and.returnValue(t1);
|
||||||
spec.debugLog('msg 1');
|
spec.debugLog('msg 1');
|
||||||
expect(spec.result.debugLogs).toEqual([
|
expect(spec.doneEvent().debugLogs).toEqual([
|
||||||
{ message: 'msg 1', timestamp: t1 }
|
{ message: 'msg 1', timestamp: t1 }
|
||||||
]);
|
]);
|
||||||
timer.elapsed.and.returnValue(t2);
|
timer.elapsed.and.returnValue(t2);
|
||||||
spec.debugLog('msg 2');
|
spec.debugLog('msg 2');
|
||||||
expect(spec.result.debugLogs).toEqual([
|
expect(spec.doneEvent().debugLogs).toEqual([
|
||||||
{ message: 'msg 1', timestamp: t1 },
|
{ message: 'msg 1', timestamp: t1 },
|
||||||
{ message: 'msg 2', timestamp: t2 }
|
{ message: 'msg 2', timestamp: t2 }
|
||||||
]);
|
]);
|
||||||
@@ -433,7 +506,7 @@ describe('Spec', function() {
|
|||||||
spec.debugLog('msg');
|
spec.debugLog('msg');
|
||||||
spec.executionFinished();
|
spec.executionFinished();
|
||||||
|
|
||||||
expect(spec.result.debugLogs).toBeNull();
|
expect(spec.doneEvent().debugLogs).toBeNull();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -452,7 +525,7 @@ describe('Spec', function() {
|
|||||||
spec.handleException(new Error('nope'));
|
spec.handleException(new Error('nope'));
|
||||||
spec.executionFinished();
|
spec.executionFinished();
|
||||||
|
|
||||||
expect(spec.result.debugLogs).toEqual([
|
expect(spec.doneEvent().debugLogs).toEqual([
|
||||||
{ message: 'msg', timestamp: timestamp }
|
{ message: 'msg', timestamp: timestamp }
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -311,10 +311,11 @@ describe('SuiteBuilder', function() {
|
|||||||
suiteBuilder.topSuite.handleException(new Error('nope'));
|
suiteBuilder.topSuite.handleException(new Error('nope'));
|
||||||
suiteBuilder.parallelReset();
|
suiteBuilder.parallelReset();
|
||||||
|
|
||||||
expect(suiteBuilder.topSuite.result).toEqual({
|
expect(suiteBuilder.topSuite.doneEvent()).toEqual({
|
||||||
id: suiteBuilder.topSuite.id,
|
id: suiteBuilder.topSuite.id,
|
||||||
description: 'Jasmine__TopLevel__Suite',
|
description: 'Jasmine__TopLevel__Suite',
|
||||||
fullName: '',
|
fullName: '',
|
||||||
|
status: 'passed',
|
||||||
failedExpectations: [],
|
failedExpectations: [],
|
||||||
deprecationWarnings: [],
|
deprecationWarnings: [],
|
||||||
duration: null,
|
duration: null,
|
||||||
|
|||||||
+44
-14
@@ -115,20 +115,20 @@ describe('Suite', function() {
|
|||||||
const suite = new privateUnderTest.Suite({});
|
const suite = new privateUnderTest.Suite({});
|
||||||
|
|
||||||
suite.addExpectationResult(false, {});
|
suite.addExpectationResult(false, {});
|
||||||
expect(suite.getResult().status).toBe('failed');
|
expect(suite.doneEvent().status).toBe('failed');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('retrieves a result with updated status', function() {
|
it('retrieves a result with updated status', function() {
|
||||||
const suite = new privateUnderTest.Suite({});
|
const suite = new privateUnderTest.Suite({});
|
||||||
|
|
||||||
expect(suite.getResult().status).toBe('passed');
|
expect(suite.doneEvent().status).toBe('passed');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('retrieves a result with pending status', function() {
|
it('retrieves a result with pending status', function() {
|
||||||
const suite = new privateUnderTest.Suite({});
|
const suite = new privateUnderTest.Suite({});
|
||||||
suite.pend();
|
suite.pend();
|
||||||
|
|
||||||
expect(suite.getResult().status).toBe('pending');
|
expect(suite.doneEvent().status).toBe('pending');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws an ExpectationFailed when receiving a failed expectation when throwOnExpectationFailure is set', function() {
|
it('throws an ExpectationFailed when receiving a failed expectation when throwOnExpectationFailure is set', function() {
|
||||||
@@ -140,8 +140,8 @@ describe('Suite', function() {
|
|||||||
suite.addExpectationResult(false, { message: 'failed' });
|
suite.addExpectationResult(false, { message: 'failed' });
|
||||||
}).toThrowError(jasmineUnderTest.private.errors.ExpectationFailed);
|
}).toThrowError(jasmineUnderTest.private.errors.ExpectationFailed);
|
||||||
|
|
||||||
expect(suite.getResult().status).toBe('failed');
|
expect(suite.doneEvent().status).toBe('failed');
|
||||||
expect(suite.result.failedExpectations).toEqual([
|
expect(suite.doneEvent().failedExpectations).toEqual([
|
||||||
jasmine.objectContaining({ message: 'failed' })
|
jasmine.objectContaining({ message: 'failed' })
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
@@ -153,7 +153,7 @@ describe('Suite', function() {
|
|||||||
new jasmineUnderTest.private.errors.ExpectationFailed()
|
new jasmineUnderTest.private.errors.ExpectationFailed()
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(suite.getResult().failedExpectations).toEqual([]);
|
expect(suite.doneEvent().failedExpectations).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('forwards late expectation failures to onLateError', function() {
|
it('forwards late expectation failures to onLateError', function() {
|
||||||
@@ -175,7 +175,7 @@ describe('Suite', function() {
|
|||||||
message: jasmine.stringMatching(/^Error: nope/)
|
message: jasmine.stringMatching(/^Error: nope/)
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
expect(suite.result.failedExpectations).toEqual([]);
|
expect(suite.doneEvent().failedExpectations).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not forward non-late expectation failures to onLateError', function() {
|
it('does not forward non-late expectation failures to onLateError', function() {
|
||||||
@@ -194,7 +194,7 @@ describe('Suite', function() {
|
|||||||
suite.addExpectationResult(false, data, true);
|
suite.addExpectationResult(false, data, true);
|
||||||
|
|
||||||
expect(onLateError).not.toHaveBeenCalled();
|
expect(onLateError).not.toHaveBeenCalled();
|
||||||
expect(suite.result.failedExpectations.length).toEqual(1);
|
expect(suite.doneEvent().failedExpectations.length).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('forwards late handleException calls to onLateError', function() {
|
it('forwards late handleException calls to onLateError', function() {
|
||||||
@@ -212,7 +212,7 @@ describe('Suite', function() {
|
|||||||
message: jasmine.stringMatching(/^Error: oops/)
|
message: jasmine.stringMatching(/^Error: oops/)
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
expect(suite.result.failedExpectations).toEqual([]);
|
expect(suite.doneEvent().failedExpectations).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not forward non-late handleException calls to onLateError', function() {
|
it('does not forward non-late handleException calls to onLateError', function() {
|
||||||
@@ -225,7 +225,7 @@ describe('Suite', function() {
|
|||||||
suite.handleException(error);
|
suite.handleException(error);
|
||||||
|
|
||||||
expect(onLateError).not.toHaveBeenCalled();
|
expect(onLateError).not.toHaveBeenCalled();
|
||||||
expect(suite.result.failedExpectations.length).toEqual(1);
|
expect(suite.doneEvent().failedExpectations.length).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('clears the reportedDone flag when reset', function() {
|
it('clears the reportedDone flag when reset', function() {
|
||||||
@@ -248,7 +248,7 @@ describe('Suite', function() {
|
|||||||
});
|
});
|
||||||
suite.startTimer();
|
suite.startTimer();
|
||||||
suite.endTimer();
|
suite.endTimer();
|
||||||
expect(suite.getResult().duration).toEqual(77000);
|
expect(suite.doneEvent().duration).toEqual(77000);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#sharedUserContext', function() {
|
describe('#sharedUserContext', function() {
|
||||||
@@ -306,14 +306,14 @@ describe('Suite', function() {
|
|||||||
const suite = new privateUnderTest.Suite({});
|
const suite = new privateUnderTest.Suite({});
|
||||||
suite.pend();
|
suite.pend();
|
||||||
suite.reset();
|
suite.reset();
|
||||||
expect(suite.getResult().status).toBe('passed');
|
expect(suite.doneEvent().status).toBe('passed');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not reset the "pending" status when the suite was excluded', function() {
|
it('should not reset the "pending" status when the suite was excluded', function() {
|
||||||
const suite = new privateUnderTest.Suite({});
|
const suite = new privateUnderTest.Suite({});
|
||||||
suite.exclude();
|
suite.exclude();
|
||||||
suite.reset();
|
suite.reset();
|
||||||
expect(suite.getResult().status).toBe('pending');
|
expect(suite.doneEvent().status).toBe('pending');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should also reset the children', function() {
|
it('should also reset the children', function() {
|
||||||
@@ -335,7 +335,7 @@ describe('Suite', function() {
|
|||||||
|
|
||||||
suite.reset();
|
suite.reset();
|
||||||
|
|
||||||
const result = suite.getResult();
|
const result = suite.doneEvent();
|
||||||
expect(result.status).toBe('passed');
|
expect(result.status).toBe('passed');
|
||||||
expect(result.failedExpectations).toHaveSize(0);
|
expect(result.failedExpectations).toHaveSize(0);
|
||||||
});
|
});
|
||||||
@@ -425,4 +425,34 @@ describe('Suite', function() {
|
|||||||
}).toThrowError("Value can't be cloned");
|
}).toThrowError("Value can't be cloned");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('#startedEvent', function() {
|
||||||
|
it('includes only properties that are known before execution', function() {
|
||||||
|
const topSuite = new privateUnderTest.Suite({});
|
||||||
|
const parentSuite = new privateUnderTest.Suite({
|
||||||
|
id: 'suite1',
|
||||||
|
parentSuite: topSuite,
|
||||||
|
description: 'a parent suite'
|
||||||
|
});
|
||||||
|
const suite = new privateUnderTest.Suite({
|
||||||
|
id: 'suite2',
|
||||||
|
parentSuite,
|
||||||
|
reportedParentSuiteId: parentSuite.id,
|
||||||
|
description: 'a suite',
|
||||||
|
filename: 'somefile.js',
|
||||||
|
getPath() {
|
||||||
|
return ['a parent suite', 'a spec'];
|
||||||
|
},
|
||||||
|
queueableFn: { fn: () => {} }
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(suite.startedEvent()).toEqual({
|
||||||
|
id: 'suite2',
|
||||||
|
parentSuiteId: 'suite1',
|
||||||
|
description: 'a suite',
|
||||||
|
fullName: 'a parent suite a suite',
|
||||||
|
filename: 'somefile.js'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ describe('TreeProcessor', function() {
|
|||||||
attrs = attrs || {};
|
attrs = attrs || {};
|
||||||
this.id = 'node' + nodeNumber++;
|
this.id = 'node' + nodeNumber++;
|
||||||
this.children = attrs.children || [];
|
this.children = attrs.children || [];
|
||||||
this.canBeReentered = function() {
|
|
||||||
return !attrs.noReenter;
|
|
||||||
};
|
|
||||||
this.markedPending = attrs.markedPending || false;
|
this.markedPending = attrs.markedPending || false;
|
||||||
this.sharedUserContext = function() {
|
this.sharedUserContext = function() {
|
||||||
return attrs.userContext || {};
|
return attrs.userContext || {};
|
||||||
@@ -195,47 +192,6 @@ describe('TreeProcessor', function() {
|
|||||||
expect(result.isExcluded(childOfPending)).toEqual(false);
|
expect(result.isExcluded(childOfPending)).toEqual(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws if the specified order would re-enter a node', function() {
|
|
||||||
const leaf1 = new Leaf(),
|
|
||||||
leaf2 = new Leaf(),
|
|
||||||
leaf3 = new Leaf(),
|
|
||||||
reentered = new Node({ noReenter: true, children: [leaf1, leaf2] }),
|
|
||||||
root = new Node({ children: [reentered, leaf3] }),
|
|
||||||
processor = new privateUnderTest.TreeProcessor({
|
|
||||||
tree: root,
|
|
||||||
runnableIds: [leaf1.id, leaf3.id, leaf2.id]
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(function() {
|
|
||||||
processor.processTree();
|
|
||||||
}).toThrowError('Invalid order: would split up a suite');
|
|
||||||
});
|
|
||||||
|
|
||||||
it("does not throw if a node which can't be re-entered is only entered once", function() {
|
|
||||||
const leaf1 = new Leaf(),
|
|
||||||
leaf2 = new Leaf(),
|
|
||||||
leaf3 = new Leaf(),
|
|
||||||
noReentry = new Node({ noReenter: true }),
|
|
||||||
root = new Node({ children: [noReentry] }),
|
|
||||||
processor = new privateUnderTest.TreeProcessor({
|
|
||||||
tree: root,
|
|
||||||
runnableIds: [leaf2.id, leaf1.id, leaf3.id]
|
|
||||||
});
|
|
||||||
|
|
||||||
processor.processTree();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("does not throw if a node which can't be re-entered is run directly", function() {
|
|
||||||
const noReentry = new Node({ noReenter: true }),
|
|
||||||
root = new Node({ children: [noReentry] }),
|
|
||||||
processor = new privateUnderTest.TreeProcessor({
|
|
||||||
tree: root,
|
|
||||||
runnableIds: [root.id]
|
|
||||||
});
|
|
||||||
|
|
||||||
processor.processTree();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('orders children according to orderChildren when specified', function() {
|
it('orders children according to orderChildren when specified', function() {
|
||||||
const leaf1 = new Leaf();
|
const leaf1 = new Leaf();
|
||||||
const leaf2 = new Leaf();
|
const leaf2 = new Leaf();
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ describe('TreeRunner', function() {
|
|||||||
expect(currentRunableTracker.currentSpec()).toBeFalsy();
|
expect(currentRunableTracker.currentSpec()).toBeFalsy();
|
||||||
expect(runableResources.clearForRunable).toHaveBeenCalledWith(spec.id);
|
expect(runableResources.clearForRunable).toHaveBeenCalledWith(spec.id);
|
||||||
expect(reportDispatcher.specDone).toHaveBeenCalledWith(spec.doneEvent());
|
expect(reportDispatcher.specDone).toHaveBeenCalledWith(spec.doneEvent());
|
||||||
expect(spec.result.duration).toEqual('the elapsed time');
|
expect(spec.doneEvent().duration).toEqual('the elapsed time');
|
||||||
expect(spec.reportedDone).toEqual(true);
|
expect(spec.reportedDone).toEqual(true);
|
||||||
await Promise.resolve();
|
await Promise.resolve();
|
||||||
await Promise.resolve();
|
await Promise.resolve();
|
||||||
@@ -116,8 +116,8 @@ describe('TreeRunner', function() {
|
|||||||
expect(specRunQueueArgs.queueableFns[1]).toEqual(queueableFn);
|
expect(specRunQueueArgs.queueableFns[1]).toEqual(queueableFn);
|
||||||
queueableFn.fn();
|
queueableFn.fn();
|
||||||
|
|
||||||
expect(spec.getResult().status).toEqual('pending');
|
expect(spec.doneEvent().status).toEqual('pending');
|
||||||
expect(spec.getResult().pendingReason).toEqual('');
|
expect(spec.doneEvent().pendingReason).toEqual('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('marks specs pending at runtime with a message', function() {
|
it('marks specs pending at runtime with a message', function() {
|
||||||
@@ -137,8 +137,8 @@ describe('TreeRunner', function() {
|
|||||||
expect(specRunQueueArgs.queueableFns[1]).toEqual(queueableFn);
|
expect(specRunQueueArgs.queueableFns[1]).toEqual(queueableFn);
|
||||||
queueableFn.fn();
|
queueableFn.fn();
|
||||||
|
|
||||||
expect(spec.getResult().status).toEqual('pending');
|
expect(spec.doneEvent().status).toEqual('pending');
|
||||||
expect(spec.getResult().pendingReason).toEqual('some reason');
|
expect(spec.doneEvent().pendingReason).toEqual('some reason');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('passes failSpecWithNoExp to Spec#executionFinished', async function() {
|
it('passes failSpecWithNoExp to Spec#executionFinished', async function() {
|
||||||
@@ -218,7 +218,7 @@ describe('TreeRunner', function() {
|
|||||||
timer.elapsed.and.returnValue('the duration');
|
timer.elapsed.and.returnValue('the duration');
|
||||||
suiteRunQueueOpts.onComplete();
|
suiteRunQueueOpts.onComplete();
|
||||||
expect(timer.elapsed).toHaveBeenCalled();
|
expect(timer.elapsed).toHaveBeenCalled();
|
||||||
const result = suite.getResult();
|
const result = suite.doneEvent();
|
||||||
expect(result.duration).toEqual('the duration');
|
expect(result.duration).toEqual('the duration');
|
||||||
expect(reportDispatcher.suiteDone).toHaveBeenCalledWith(result);
|
expect(reportDispatcher.suiteDone).toHaveBeenCalledWith(result);
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,5 @@
|
|||||||
describe('base helpers', function() {
|
describe('base helpers', function() {
|
||||||
describe('isError', function() {
|
describe('isError', function() {
|
||||||
it('correctly handles WebSocket events', function(done) {
|
|
||||||
if (typeof jasmine.getGlobal().WebSocket === 'undefined') {
|
|
||||||
pending('Environment does not provide WebSocket');
|
|
||||||
}
|
|
||||||
|
|
||||||
const obj = (function() {
|
|
||||||
const sock = new WebSocket('ws://localhost');
|
|
||||||
let event;
|
|
||||||
sock.onerror = function(e) {
|
|
||||||
event = e;
|
|
||||||
};
|
|
||||||
return function() {
|
|
||||||
return event;
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
let left = 20;
|
|
||||||
|
|
||||||
const int = setInterval(function() {
|
|
||||||
if (obj() || left === 0) {
|
|
||||||
const result = privateUnderTest.isError(obj());
|
|
||||||
expect(result).toBe(false);
|
|
||||||
clearInterval(int);
|
|
||||||
done();
|
|
||||||
} else {
|
|
||||||
left--;
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns true for an Error subclass', function() {
|
it('returns true for an Error subclass', function() {
|
||||||
function MyError() {}
|
function MyError() {}
|
||||||
MyError.prototype = new Error();
|
MyError.prototype = new Error();
|
||||||
|
|||||||
@@ -1765,10 +1765,12 @@ describe('Env integration', function() {
|
|||||||
|
|
||||||
const baseSuiteEvent = {
|
const baseSuiteEvent = {
|
||||||
id: jasmine.any(String),
|
id: jasmine.any(String),
|
||||||
filename: jasmine.any(String),
|
filename: jasmine.any(String)
|
||||||
|
};
|
||||||
|
const baseSuiteDoneEvent = {
|
||||||
|
...baseSuiteEvent,
|
||||||
failedExpectations: [],
|
failedExpectations: [],
|
||||||
deprecationWarnings: [],
|
deprecationWarnings: [],
|
||||||
duration: null,
|
|
||||||
properties: null
|
properties: null
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1779,7 +1781,7 @@ describe('Env integration', function() {
|
|||||||
parentSuiteId: null
|
parentSuiteId: null
|
||||||
});
|
});
|
||||||
expect(reporter.suiteDone.calls.argsFor(2)[0]).toEqual({
|
expect(reporter.suiteDone.calls.argsFor(2)[0]).toEqual({
|
||||||
...baseSuiteEvent,
|
...baseSuiteDoneEvent,
|
||||||
description: 'A Suite',
|
description: 'A Suite',
|
||||||
fullName: 'A Suite',
|
fullName: 'A Suite',
|
||||||
status: 'passed',
|
status: 'passed',
|
||||||
@@ -1794,7 +1796,7 @@ describe('Env integration', function() {
|
|||||||
parentSuiteId: suiteFullNameToId['A Suite']
|
parentSuiteId: suiteFullNameToId['A Suite']
|
||||||
});
|
});
|
||||||
expect(reporter.suiteDone.calls.argsFor(0)[0]).toEqual({
|
expect(reporter.suiteDone.calls.argsFor(0)[0]).toEqual({
|
||||||
...baseSuiteEvent,
|
...baseSuiteDoneEvent,
|
||||||
description: 'with a nested suite',
|
description: 'with a nested suite',
|
||||||
status: 'passed',
|
status: 'passed',
|
||||||
fullName: 'A Suite with a nested suite',
|
fullName: 'A Suite with a nested suite',
|
||||||
@@ -1809,7 +1811,7 @@ describe('Env integration', function() {
|
|||||||
parentSuiteId: suiteFullNameToId['A Suite']
|
parentSuiteId: suiteFullNameToId['A Suite']
|
||||||
});
|
});
|
||||||
expect(reporter.suiteDone.calls.argsFor(1)[0]).toEqual({
|
expect(reporter.suiteDone.calls.argsFor(1)[0]).toEqual({
|
||||||
...baseSuiteEvent,
|
...baseSuiteDoneEvent,
|
||||||
description: 'with only non-executable specs',
|
description: 'with only non-executable specs',
|
||||||
status: 'passed',
|
status: 'passed',
|
||||||
fullName: 'A Suite with only non-executable specs',
|
fullName: 'A Suite with only non-executable specs',
|
||||||
|
|||||||
@@ -53,17 +53,17 @@ describe('Global error handling (integration)', function() {
|
|||||||
passed: false,
|
passed: false,
|
||||||
globalErrorType: 'load',
|
globalErrorType: 'load',
|
||||||
message: 'Uncaught SyntaxError: Unexpected end of input',
|
message: 'Uncaught SyntaxError: Unexpected end of input',
|
||||||
stack: undefined,
|
|
||||||
filename: 'borkenSpec.js',
|
filename: 'borkenSpec.js',
|
||||||
lineno: 42
|
lineno: 42,
|
||||||
|
matcherName: undefined,
|
||||||
|
stack: jasmine.any(String)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
passed: false,
|
passed: false,
|
||||||
globalErrorType: 'load',
|
globalErrorType: 'load',
|
||||||
message: 'ENOCHEESE',
|
message: 'ENOCHEESE',
|
||||||
stack: error.stack,
|
matcherName: undefined,
|
||||||
filename: undefined,
|
stack: jasmine.any(String)
|
||||||
lineno: undefined
|
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -53,8 +53,9 @@ describe('The jasmine namespace', function() {
|
|||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
// jasmine-html.js
|
// jasmine-html.js
|
||||||
result.add('HtmlReporter');
|
result.add('HtmlReporter');
|
||||||
|
result.add('HtmlReporterV2');
|
||||||
|
result.add('HtmlReporterV2Urls');
|
||||||
result.add('HtmlSpecFilter');
|
result.add('HtmlSpecFilter');
|
||||||
result.add('HtmlExactSpecFilter');
|
|
||||||
result.add('QueryString');
|
result.add('QueryString');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
describe('HtmlExactSpecFilter', function() {
|
|
||||||
it('matches everything when no string is provided', function() {
|
|
||||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
|
||||||
queryString: {
|
|
||||||
getParam(name) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(specFilter.matches({})).toBeTrue();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('matches a spec with the exact same path', function() {
|
|
||||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
|
||||||
queryString: {
|
|
||||||
getParam(name) {
|
|
||||||
if (name === 'spec') {
|
|
||||||
return '["a","b","c"]';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(specFilter.matches(stubSpec(['a', 'b', 'c']))).toBeTrue();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('matches a spec whose path has the filter path as a prefix', function() {
|
|
||||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
|
||||||
queryString: {
|
|
||||||
getParam(name) {
|
|
||||||
if (name === 'spec') {
|
|
||||||
return '["a","b"]';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(specFilter.matches(stubSpec(['a', 'b', 'c']))).toBeTrue();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('does not match a spec with a different path', function() {
|
|
||||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
|
||||||
queryString: {
|
|
||||||
getParam(name) {
|
|
||||||
if (name === 'spec') {
|
|
||||||
return '["a","b","c"]';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(specFilter.matches(stubSpec(['a', 'd', 'c']))).toBeFalse();
|
|
||||||
});
|
|
||||||
|
|
||||||
function stubSpec(path) {
|
|
||||||
return {
|
|
||||||
getPath() {
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
+118
-346
@@ -3,12 +3,29 @@ describe('HtmlReporter', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
env = new privateUnderTest.Env();
|
env = new privateUnderTest.Env();
|
||||||
|
spyOn(env, 'deprecated');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
env.cleanup_();
|
env.cleanup_();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('emits a deprecation warning', function() {
|
||||||
|
const container = document.createElement('div'),
|
||||||
|
getContainer = function() {
|
||||||
|
return container;
|
||||||
|
},
|
||||||
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
|
env: env,
|
||||||
|
getContainer: getContainer
|
||||||
|
});
|
||||||
|
reporter.initialize();
|
||||||
|
|
||||||
|
expect(env.deprecated).toHaveBeenCalledWith(
|
||||||
|
'HtmlReporter and HtmlSpecFilter are deprecated. Use HtmlReporterV2 instead.'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('builds the initial DOM elements, including the title banner', function() {
|
it('builds the initial DOM elements, including the title banner', function() {
|
||||||
const container = document.createElement('div'),
|
const container = document.createElement('div'),
|
||||||
getContainer = function() {
|
getContainer = function() {
|
||||||
@@ -16,13 +33,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
|
|
||||||
@@ -52,13 +63,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -79,12 +84,6 @@ describe('HtmlReporter', function() {
|
|||||||
env: env,
|
env: env,
|
||||||
getContainer: function() {
|
getContainer: function() {
|
||||||
return container;
|
return container;
|
||||||
},
|
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -132,13 +131,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
reporter.specDone({
|
reporter.specDone({
|
||||||
@@ -164,13 +157,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
|
|
||||||
@@ -193,13 +180,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
|
|
||||||
@@ -223,13 +204,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -255,13 +230,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -310,13 +279,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -360,13 +323,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -393,13 +350,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -434,13 +385,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
spyOn(console, 'error');
|
spyOn(console, 'error');
|
||||||
@@ -478,13 +423,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -507,12 +446,6 @@ describe('HtmlReporter', function() {
|
|||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer,
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
},
|
|
||||||
addToExistingQueryString: function(key, value) {
|
addToExistingQueryString: function(key, value) {
|
||||||
return '?foo=bar&' + key + '=' + value;
|
return '?foo=bar&' + key + '=' + value;
|
||||||
}
|
}
|
||||||
@@ -528,7 +461,6 @@ describe('HtmlReporter', function() {
|
|||||||
|
|
||||||
let specResult = {
|
let specResult = {
|
||||||
id: 123,
|
id: 123,
|
||||||
parentSuiteId: 1,
|
|
||||||
description: 'with a spec',
|
description: 'with a spec',
|
||||||
fullName: 'A Suite with a spec',
|
fullName: 'A Suite with a spec',
|
||||||
status: 'passed',
|
status: 'passed',
|
||||||
@@ -606,9 +538,7 @@ describe('HtmlReporter', function() {
|
|||||||
const suiteDetail = outerSuite.childNodes[0];
|
const suiteDetail = outerSuite.childNodes[0];
|
||||||
const suiteLink = suiteDetail.childNodes[0];
|
const suiteLink = suiteDetail.childNodes[0];
|
||||||
expect(suiteLink.innerHTML).toEqual('A Suite');
|
expect(suiteLink.innerHTML).toEqual('A Suite');
|
||||||
expect(suiteLink.getAttribute('href')).toEqual(
|
expect(suiteLink.getAttribute('href')).toEqual('/?foo=bar&spec=A Suite');
|
||||||
'/?foo=bar&spec=["A Suite"]'
|
|
||||||
);
|
|
||||||
|
|
||||||
const specs = outerSuite.childNodes[1];
|
const specs = outerSuite.childNodes[1];
|
||||||
const spec = specs.childNodes[0];
|
const spec = specs.childNodes[0];
|
||||||
@@ -618,7 +548,7 @@ describe('HtmlReporter', function() {
|
|||||||
const specLink = spec.childNodes[0];
|
const specLink = spec.childNodes[0];
|
||||||
expect(specLink.innerHTML).toEqual('with a spec');
|
expect(specLink.innerHTML).toEqual('with a spec');
|
||||||
expect(specLink.getAttribute('href')).toEqual(
|
expect(specLink.getAttribute('href')).toEqual(
|
||||||
'/?foo=bar&spec=["A Suite","with a spec"]'
|
'/?foo=bar&spec=A Suite with a spec'
|
||||||
);
|
);
|
||||||
|
|
||||||
const specDuration = spec.childNodes[1];
|
const specDuration = spec.childNodes[1];
|
||||||
@@ -632,13 +562,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -670,13 +594,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -716,13 +634,7 @@ describe('HtmlReporter', function() {
|
|||||||
};
|
};
|
||||||
const reporter = new jasmineUnderTest.HtmlReporter({
|
const reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -760,13 +672,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -802,13 +708,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -825,13 +725,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
env.configure({ stopOnSpecFailure: true });
|
env.configure({ stopOnSpecFailure: true });
|
||||||
@@ -852,13 +746,7 @@ describe('HtmlReporter', function() {
|
|||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
navigateWithNewParam: navigationHandler,
|
navigateWithNewParam: navigationHandler,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -882,13 +770,7 @@ describe('HtmlReporter', function() {
|
|||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
navigateWithNewParam: navigationHandler,
|
navigateWithNewParam: navigationHandler,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
env.configure({ stopOnSpecFailure: true });
|
env.configure({ stopOnSpecFailure: true });
|
||||||
@@ -914,13 +796,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -939,13 +815,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
env.configure({ stopSpecOnExpectationFailure: true });
|
env.configure({ stopSpecOnExpectationFailure: true });
|
||||||
@@ -968,13 +838,7 @@ describe('HtmlReporter', function() {
|
|||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer,
|
||||||
navigateWithNewParam: navigateHandler,
|
navigateWithNewParam: navigateHandler
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -1000,13 +864,7 @@ describe('HtmlReporter', function() {
|
|||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer,
|
||||||
navigateWithNewParam: navigateHandler,
|
navigateWithNewParam: navigateHandler
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
env.configure({ stopSpecOnExpectationFailure: true });
|
env.configure({ stopSpecOnExpectationFailure: true });
|
||||||
@@ -1025,22 +883,19 @@ describe('HtmlReporter', function() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('UI for hiding disabled specs', function() {
|
describe('UI for hiding disabled specs', function() {
|
||||||
it('should be unchecked if not hiding disabled specs', function() {
|
it('should be unchecked if not hiding disabled specs', function() {
|
||||||
const container = document.createElement('div'),
|
const container = document.createElement('div');
|
||||||
getContainer = function() {
|
const getContainer = function() {
|
||||||
return container;
|
return container;
|
||||||
},
|
};
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
const navigateHandler = jasmine.createSpy('navigate');
|
||||||
env: env,
|
const reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
getContainer: getContainer,
|
env: env,
|
||||||
createElement: function() {
|
getContainer: getContainer,
|
||||||
return document.createElement.apply(document, arguments);
|
navigateWithNewParam: navigateHandler
|
||||||
},
|
});
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
env.configure({ hideDisabled: false });
|
env.configure({ hideDisabled: false });
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -1048,23 +903,22 @@ describe('HtmlReporter', function() {
|
|||||||
|
|
||||||
const disabledUI = container.querySelector('.jasmine-disabled');
|
const disabledUI = container.querySelector('.jasmine-disabled');
|
||||||
expect(disabledUI.checked).toBe(false);
|
expect(disabledUI.checked).toBe(false);
|
||||||
|
|
||||||
|
disabledUI.click();
|
||||||
|
expect(navigateHandler).toHaveBeenCalledWith('hideDisabled', true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be checked if hiding disabled', function() {
|
it('should be checked if hiding disabled', function() {
|
||||||
const container = document.createElement('div'),
|
const container = document.createElement('div');
|
||||||
getContainer = function() {
|
const getContainer = function() {
|
||||||
return container;
|
return container;
|
||||||
},
|
};
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
const navigateHandler = jasmine.createSpy('navigate');
|
||||||
env: env,
|
const reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
getContainer: getContainer,
|
env: env,
|
||||||
createElement: function() {
|
getContainer: getContainer,
|
||||||
return document.createElement.apply(document, arguments);
|
navigateWithNewParam: navigateHandler
|
||||||
},
|
});
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
env.configure({ hideDisabled: true });
|
env.configure({ hideDisabled: true });
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -1072,6 +926,9 @@ describe('HtmlReporter', function() {
|
|||||||
|
|
||||||
const disabledUI = container.querySelector('.jasmine-disabled');
|
const disabledUI = container.querySelector('.jasmine-disabled');
|
||||||
expect(disabledUI.checked).toBe(true);
|
expect(disabledUI.checked).toBe(true);
|
||||||
|
|
||||||
|
disabledUI.click();
|
||||||
|
expect(navigateHandler).toHaveBeenCalledWith('hideDisabled', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not display specs that have been disabled', function() {
|
it('should not display specs that have been disabled', function() {
|
||||||
@@ -1081,13 +938,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
env.configure({ hideDisabled: true });
|
env.configure({ hideDisabled: true });
|
||||||
@@ -1106,6 +957,7 @@ describe('HtmlReporter', function() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('UI for running tests in random order', function() {
|
describe('UI for running tests in random order', function() {
|
||||||
it('should be unchecked if not randomizing', function() {
|
it('should be unchecked if not randomizing', function() {
|
||||||
const container = document.createElement('div'),
|
const container = document.createElement('div'),
|
||||||
@@ -1114,13 +966,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
env.configure({ random: false });
|
env.configure({ random: false });
|
||||||
@@ -1138,13 +984,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
env.configure({ random: true });
|
env.configure({ random: true });
|
||||||
@@ -1164,13 +1004,7 @@ describe('HtmlReporter', function() {
|
|||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer,
|
||||||
navigateWithNewParam: navigateHandler,
|
navigateWithNewParam: navigateHandler
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
env.configure({ random: false });
|
env.configure({ random: false });
|
||||||
@@ -1192,13 +1026,7 @@ describe('HtmlReporter', function() {
|
|||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer,
|
||||||
navigateWithNewParam: navigateHandler,
|
navigateWithNewParam: navigateHandler
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
env.configure({ random: true });
|
env.configure({ random: true });
|
||||||
@@ -1218,13 +1046,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -1248,13 +1070,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -1264,6 +1080,34 @@ describe('HtmlReporter', function() {
|
|||||||
expect(seedBar).toBeNull();
|
expect(seedBar).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('includes the number of specs in the text of the jasmine-skipped link', function() {
|
||||||
|
const container = document.createElement('div');
|
||||||
|
const reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
|
env: env,
|
||||||
|
getContainer: function() {
|
||||||
|
return container;
|
||||||
|
},
|
||||||
|
addToExistingQueryString: function(key, value) {
|
||||||
|
return '?foo=bar&' + key + '=' + value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
reporter.initialize();
|
||||||
|
const minimalSpecDone = {
|
||||||
|
failedExpectations: [],
|
||||||
|
passedExpectations: []
|
||||||
|
};
|
||||||
|
|
||||||
|
reporter.jasmineStarted({ totalSpecsDefined: 3 });
|
||||||
|
reporter.specDone({ ...minimalSpecDone });
|
||||||
|
reporter.specDone({ ...minimalSpecDone });
|
||||||
|
reporter.specDone({ ...minimalSpecDone, status: 'excluded' });
|
||||||
|
reporter.jasmineDone({});
|
||||||
|
|
||||||
|
const skippedLink = container.querySelector('.jasmine-skipped a');
|
||||||
|
expect(skippedLink.textContent).toEqual('Ran 2 of 3 specs - run all');
|
||||||
|
});
|
||||||
|
|
||||||
it('should include non-spec query params in the jasmine-skipped link when present', function() {
|
it('should include non-spec query params in the jasmine-skipped link when present', function() {
|
||||||
const container = document.createElement('div'),
|
const container = document.createElement('div'),
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
@@ -1271,12 +1115,6 @@ describe('HtmlReporter', function() {
|
|||||||
getContainer: function() {
|
getContainer: function() {
|
||||||
return container;
|
return container;
|
||||||
},
|
},
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
},
|
|
||||||
addToExistingQueryString: function(key, value) {
|
addToExistingQueryString: function(key, value) {
|
||||||
return '?foo=bar&' + key + '=' + value;
|
return '?foo=bar&' + key + '=' + value;
|
||||||
}
|
}
|
||||||
@@ -1301,13 +1139,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
|
|
||||||
@@ -1362,17 +1194,6 @@ describe('HtmlReporter', function() {
|
|||||||
env: env,
|
env: env,
|
||||||
getContainer: function() {
|
getContainer: function() {
|
||||||
return container;
|
return container;
|
||||||
},
|
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
},
|
|
||||||
queryString: {
|
|
||||||
getParam(name) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
specStatus = {
|
specStatus = {
|
||||||
@@ -1387,12 +1208,7 @@ describe('HtmlReporter', function() {
|
|||||||
|
|
||||||
describe('when the specs are not filtered', function() {
|
describe('when the specs are not filtered', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
reporterConfig.queryString.getParam = function(name) {
|
reporterConfig.filterSpecs = false;
|
||||||
if (name !== 'spec') {
|
|
||||||
throw new Error('Unexpected query param ' + name);
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
};
|
|
||||||
reporter = new jasmineUnderTest.HtmlReporter(reporterConfig);
|
reporter = new jasmineUnderTest.HtmlReporter(reporterConfig);
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
reporter.jasmineStarted({ totalSpecsDefined: 1 });
|
reporter.jasmineStarted({ totalSpecsDefined: 1 });
|
||||||
@@ -1410,12 +1226,7 @@ describe('HtmlReporter', function() {
|
|||||||
|
|
||||||
describe('when the specs are filtered', function() {
|
describe('when the specs are filtered', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
reporterConfig.queryString.getParam = function(name) {
|
reporterConfig.filterSpecs = true;
|
||||||
if (name !== 'spec') {
|
|
||||||
throw new Error('Unexpected query param ' + name);
|
|
||||||
}
|
|
||||||
return 'not the empty string';
|
|
||||||
};
|
|
||||||
reporter = new jasmineUnderTest.HtmlReporter(reporterConfig);
|
reporter = new jasmineUnderTest.HtmlReporter(reporterConfig);
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
reporter.jasmineStarted({ totalSpecsDefined: 1 });
|
reporter.jasmineStarted({ totalSpecsDefined: 1 });
|
||||||
@@ -1459,13 +1270,7 @@ describe('HtmlReporter', function() {
|
|||||||
};
|
};
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
|
|
||||||
@@ -1526,12 +1331,6 @@ describe('HtmlReporter', function() {
|
|||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer,
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
},
|
|
||||||
addToExistingQueryString: function(key, value) {
|
addToExistingQueryString: function(key, value) {
|
||||||
return '?foo=bar&' + key + '=' + value;
|
return '?foo=bar&' + key + '=' + value;
|
||||||
}
|
}
|
||||||
@@ -1559,7 +1358,6 @@ describe('HtmlReporter', function() {
|
|||||||
|
|
||||||
const failingSpecResult = {
|
const failingSpecResult = {
|
||||||
id: 124,
|
id: 124,
|
||||||
parentSuiteId: 2,
|
|
||||||
status: 'failed',
|
status: 'failed',
|
||||||
description: 'a failing spec',
|
description: 'a failing spec',
|
||||||
fullName: 'a suite inner suite a failing spec',
|
fullName: 'a suite inner suite a failing spec',
|
||||||
@@ -1683,18 +1481,16 @@ describe('HtmlReporter', function() {
|
|||||||
expect(links.length).toEqual(3);
|
expect(links.length).toEqual(3);
|
||||||
expect(links[0].textContent).toEqual('A suite');
|
expect(links[0].textContent).toEqual('A suite');
|
||||||
|
|
||||||
expect(links[0].getAttribute('href')).toEqual(
|
expect(links[0].getAttribute('href')).toMatch(/\?foo=bar&spec=A suite/);
|
||||||
'/?foo=bar&spec=["A suite"]'
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(links[1].textContent).toEqual('inner suite');
|
expect(links[1].textContent).toEqual('inner suite');
|
||||||
expect(links[1].getAttribute('href')).toEqual(
|
expect(links[1].getAttribute('href')).toMatch(
|
||||||
'/?foo=bar&spec=["A suite","inner suite"]'
|
/\?foo=bar&spec=A suite inner suite/
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(links[2].textContent).toEqual('a failing spec');
|
expect(links[2].textContent).toEqual('a failing spec');
|
||||||
expect(links[2].getAttribute('href')).toEqual(
|
expect(links[2].getAttribute('href')).toMatch(
|
||||||
'/?foo=bar&spec=["A suite","inner suite","a failing spec"]'
|
/\?foo=bar&spec=a suite inner suite a failing spec/
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1724,12 +1520,6 @@ describe('HtmlReporter', function() {
|
|||||||
const reporter = new jasmineUnderTest.HtmlReporter({
|
const reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer,
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
},
|
|
||||||
addToExistingQueryString: function(key, value) {
|
addToExistingQueryString: function(key, value) {
|
||||||
return '?' + key + '=' + value;
|
return '?' + key + '=' + value;
|
||||||
}
|
}
|
||||||
@@ -1781,13 +1571,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -1811,13 +1595,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
@@ -1841,13 +1619,7 @@ describe('HtmlReporter', function() {
|
|||||||
},
|
},
|
||||||
reporter = new jasmineUnderTest.HtmlReporter({
|
reporter = new jasmineUnderTest.HtmlReporter({
|
||||||
env: env,
|
env: env,
|
||||||
getContainer: getContainer,
|
getContainer: getContainer
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,66 @@
|
|||||||
|
describe('HtmlReporterV2Urls', function() {
|
||||||
|
describe('#configFromCurrentUrl', function() {
|
||||||
|
passesThroughQueryParam('stopOnSpecFailure');
|
||||||
|
passesThroughQueryParam('stopSpecOnExpectationFailure');
|
||||||
|
passesThroughQueryParam('random');
|
||||||
|
ignoresEmpty('random');
|
||||||
|
passesThroughQueryParam('seed');
|
||||||
|
ignoresEmpty('seed');
|
||||||
|
|
||||||
|
it('configures a matching spec filter', function() {
|
||||||
|
const queryString = mockQueryString();
|
||||||
|
queryString.getParam.withArgs('path').and.returnValue('["foo","bar"]');
|
||||||
|
const subject = new jasmineUnderTest.HtmlReporterV2Urls({ queryString });
|
||||||
|
const config = subject.configFromCurrentUrl();
|
||||||
|
const matching = {
|
||||||
|
getPath() {
|
||||||
|
return ['foo', 'bar'];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const nonMatching = {
|
||||||
|
getPath() {
|
||||||
|
return ['foobar'];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
expect(config.specFilter(matching)).toEqual(true);
|
||||||
|
expect(config.specFilter(nonMatching)).toEqual(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
function passesThroughQueryParam(k) {
|
||||||
|
it(`sets config.${k} to undefined when ${k} is not in the query string`, function() {
|
||||||
|
const queryString = mockQueryString();
|
||||||
|
queryString.getParam.withArgs(k).and.returnValue(undefined);
|
||||||
|
const subject = new jasmineUnderTest.HtmlReporterV2Urls({
|
||||||
|
queryString
|
||||||
|
});
|
||||||
|
expect(subject.configFromCurrentUrl()[k]).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`sets config.${k} to the ${k} query param`, function() {
|
||||||
|
const queryString = mockQueryString();
|
||||||
|
queryString.getParam.withArgs(k).and.returnValue('someval');
|
||||||
|
const subject = new jasmineUnderTest.HtmlReporterV2Urls({
|
||||||
|
queryString
|
||||||
|
});
|
||||||
|
expect(subject.configFromCurrentUrl()[k]).toEqual('someval');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function ignoresEmpty(k) {
|
||||||
|
it(`sets config.${k} to undefined when the ${k} query param is empty`, function() {
|
||||||
|
const queryString = mockQueryString();
|
||||||
|
queryString.getParam.withArgs(k).and.returnValue(undefined);
|
||||||
|
const subject = new jasmineUnderTest.HtmlReporterV2Urls({
|
||||||
|
queryString
|
||||||
|
});
|
||||||
|
expect(subject.configFromCurrentUrl()[k]).toBeUndefined();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function mockQueryString() {
|
||||||
|
const qs = jasmine.createSpyObj('queryString', ['getParam']);
|
||||||
|
qs.getParam.and.returnValue('NOT STUBBED');
|
||||||
|
return qs;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,4 +1,15 @@
|
|||||||
describe('HtmlSpecFilter', function() {
|
describe('HtmlSpecFilter', function() {
|
||||||
|
beforeEach(function() {
|
||||||
|
spyOn(jasmineUnderTest.getEnv(), 'deprecated');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('emits a deprecation warning', function() {
|
||||||
|
new jasmineUnderTest.HtmlSpecFilter();
|
||||||
|
expect(jasmineUnderTest.getEnv().deprecated).toHaveBeenCalledWith(
|
||||||
|
'HtmlReporter and HtmlSpecFilter are deprecated. Use HtmlReporterV2 instead.'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('should match when no string is provided', function() {
|
it('should match when no string is provided', function() {
|
||||||
const specFilter = new jasmineUnderTest.HtmlSpecFilter();
|
const specFilter = new jasmineUnderTest.HtmlSpecFilter();
|
||||||
|
|
||||||
@@ -16,17 +27,4 @@ describe('HtmlSpecFilter', function() {
|
|||||||
expect(specFilter.matches('foo')).toBe(true);
|
expect(specFilter.matches('foo')).toBe(true);
|
||||||
expect(specFilter.matches('bar')).toBe(false);
|
expect(specFilter.matches('bar')).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('copes with HtmlExactSpecFilterV2 filter strings', function() {
|
|
||||||
const specFilter = new jasmineUnderTest.HtmlSpecFilter({
|
|
||||||
filterString: function() {
|
|
||||||
return '["foo","bar"]';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(specFilter.matches('foo bar')).toBe(true);
|
|
||||||
expect(specFilter.matches('baz foo bar qux')).toBe(true);
|
|
||||||
expect(specFilter.matches('foo')).toBe(false);
|
|
||||||
expect(specFilter.matches('bar')).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
describe('HtmlSpecFilterV2', function() {
|
||||||
|
it('matches everything when no string is provided', function() {
|
||||||
|
const specFilter = new privateUnderTest.HtmlSpecFilterV2({
|
||||||
|
filterString() {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(specFilter.matches({})).toBeTrue();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('matches a spec with the exact same path', function() {
|
||||||
|
const specFilter = new privateUnderTest.HtmlSpecFilterV2({
|
||||||
|
filterString() {
|
||||||
|
return '["a","b","c"]';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(specFilter.matches(stubSpec(['a', 'b', 'c']))).toBeTrue();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('matches a spec whose path has the filter path as a prefix', function() {
|
||||||
|
const specFilter = new privateUnderTest.HtmlSpecFilterV2({
|
||||||
|
filterString() {
|
||||||
|
return '["a","b"]';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(specFilter.matches(stubSpec(['a', 'b', 'c']))).toBeTrue();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('does not match a spec with a different path', function() {
|
||||||
|
const specFilter = new privateUnderTest.HtmlSpecFilterV2({
|
||||||
|
filterString() {
|
||||||
|
return '["a","b","c"]';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(specFilter.matches(stubSpec(['a', 'd', 'c']))).toBeFalse();
|
||||||
|
});
|
||||||
|
|
||||||
|
function stubSpec(path) {
|
||||||
|
return {
|
||||||
|
getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This file starts the process of "booting" Jasmine. It initializes Jasmine,
|
This file starts the process of "booting" Jasmine. It initializes Jasmine,
|
||||||
makes its globals available, and creates the env. This file should be loaded
|
makes its globals available, and creates the env. This file should be loaded
|
||||||
|
|||||||
+9
-53
@@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This file finishes 'booting' Jasmine, performing all of the necessary
|
This file finishes 'booting' Jasmine, performing all of the necessary
|
||||||
initialization before executing the loaded environment and all of a project's
|
initialization before executing the loaded environment and all of a project's
|
||||||
@@ -13,55 +15,18 @@
|
|||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
const env = jasmine.getEnv();
|
const env = jasmine.getEnv();
|
||||||
|
const urls = new jasmine.HtmlReporterV2Urls();
|
||||||
const queryString = new jasmine.QueryString({
|
|
||||||
getWindowLocation: function() {
|
|
||||||
return window.location;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const config = {
|
|
||||||
stopOnSpecFailure: queryString.getParam('stopOnSpecFailure'),
|
|
||||||
stopSpecOnExpectationFailure: queryString.getParam(
|
|
||||||
'stopSpecOnExpectationFailure'
|
|
||||||
),
|
|
||||||
hideDisabled: queryString.getParam('hideDisabled')
|
|
||||||
};
|
|
||||||
|
|
||||||
const random = queryString.getParam('random');
|
|
||||||
|
|
||||||
if (random !== undefined && random !== '') {
|
|
||||||
config.random = random;
|
|
||||||
}
|
|
||||||
|
|
||||||
const seed = queryString.getParam('seed');
|
|
||||||
if (seed) {
|
|
||||||
config.seed = seed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ## Reporters
|
* ## Reporters
|
||||||
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
|
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
|
||||||
*/
|
*/
|
||||||
const htmlReporter = new jasmine.HtmlReporter({
|
const htmlReporter = new jasmine.HtmlReporterV2({
|
||||||
env: env,
|
env,
|
||||||
navigateWithNewParam: function(key, value) {
|
urls,
|
||||||
return queryString.navigateWithNewParam(key, value);
|
getContainer() {
|
||||||
},
|
|
||||||
addToExistingQueryString: function(key, value) {
|
|
||||||
return queryString.fullStringWithNewParam(key, value);
|
|
||||||
},
|
|
||||||
getContainer: function() {
|
|
||||||
return document.body;
|
return document.body;
|
||||||
},
|
}
|
||||||
createElement: function() {
|
|
||||||
return document.createElement.apply(document, arguments);
|
|
||||||
},
|
|
||||||
createTextNode: function() {
|
|
||||||
return document.createTextNode.apply(document, arguments);
|
|
||||||
},
|
|
||||||
timer: new jasmine.Timer(),
|
|
||||||
queryString
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,16 +34,7 @@
|
|||||||
*/
|
*/
|
||||||
env.addReporter(jsApiReporter);
|
env.addReporter(jsApiReporter);
|
||||||
env.addReporter(htmlReporter);
|
env.addReporter(htmlReporter);
|
||||||
|
env.configure(urls.configFromCurrentUrl());
|
||||||
/**
|
|
||||||
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
|
|
||||||
*/
|
|
||||||
const specFilter = new jasmine.HtmlExactSpecFilter({ queryString });
|
|
||||||
config.specFilter = function(spec) {
|
|
||||||
return specFilter.matches(spec);
|
|
||||||
};
|
|
||||||
|
|
||||||
env.configure(config);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ## Execution
|
* ## Execution
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note: Only available on Node.
|
* Note: Only available on Node.
|
||||||
* @module jasmine-core
|
* @module jasmine-core
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().CallTracker = function(j$) {
|
getJasmineRequireObj().CallTracker = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace Spy#calls
|
* @namespace Spy#calls
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().clearStack = function(j$) {
|
getJasmineRequireObj().clearStack = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
const maxInlineCallCount = 10;
|
const maxInlineCallCount = 10;
|
||||||
|
|
||||||
function browserQueueMicrotaskImpl(global) {
|
function browserQueueMicrotaskImpl(global) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Clock = function() {
|
getJasmineRequireObj().Clock = function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/* global process */
|
/* global process */
|
||||||
const NODE_JS =
|
const NODE_JS =
|
||||||
typeof process !== 'undefined' &&
|
typeof process !== 'undefined' &&
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().CompleteOnFirstErrorSkipPolicy = function(j$) {
|
getJasmineRequireObj().CompleteOnFirstErrorSkipPolicy = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function CompleteOnFirstErrorSkipPolicy(queueableFns) {
|
function CompleteOnFirstErrorSkipPolicy(queueableFns) {
|
||||||
this.queueableFns_ = queueableFns;
|
this.queueableFns_ = queueableFns;
|
||||||
this.erroredFnIx_ = null;
|
this.erroredFnIx_ = null;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Configuration = function(j$) {
|
getJasmineRequireObj().Configuration = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This represents the available options to configure Jasmine.
|
* This represents the available options to configure Jasmine.
|
||||||
* Options that are not provided will use their default values.
|
* Options that are not provided will use their default values.
|
||||||
@@ -71,6 +73,8 @@ getJasmineRequireObj().Configuration = function(j$) {
|
|||||||
specFilter: function() {
|
specFilter: function() {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// TODO: remove hideDisabled when HtmlReporter is removed
|
||||||
/**
|
/**
|
||||||
* Whether reporters should hide disabled specs from their output.
|
* Whether reporters should hide disabled specs from their output.
|
||||||
* Currently only supported by Jasmine's HTMLReporter
|
* Currently only supported by Jasmine's HTMLReporter
|
||||||
@@ -78,6 +82,7 @@ getJasmineRequireObj().Configuration = function(j$) {
|
|||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
* @type Boolean
|
* @type Boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
hideDisabled: false,
|
hideDisabled: false,
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().CurrentRunableTracker = function() {
|
getJasmineRequireObj().CurrentRunableTracker = function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class CurrentRunableTracker {
|
class CurrentRunableTracker {
|
||||||
#currentSpec;
|
#currentSpec;
|
||||||
#currentlyExecutingSuites;
|
#currentlyExecutingSuites;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Deprecator = function(j$) {
|
getJasmineRequireObj().Deprecator = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function Deprecator(topSuite) {
|
function Deprecator(topSuite) {
|
||||||
this.topSuite_ = topSuite;
|
this.topSuite_ = topSuite;
|
||||||
this.verbose_ = false;
|
this.verbose_ = false;
|
||||||
|
|||||||
+17
-7
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Env = function(j$) {
|
getJasmineRequireObj().Env = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class Env
|
* @class Env
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
@@ -67,14 +69,14 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
|
|
||||||
if (!envOptions.suppressLoadErrors) {
|
if (!envOptions.suppressLoadErrors) {
|
||||||
installGlobalErrors();
|
installGlobalErrors();
|
||||||
globalErrors.pushListener(function loadtimeErrorHandler(error, event) {
|
globalErrors.pushListener(function loadtimeErrorHandler(error) {
|
||||||
topSuite.result.failedExpectations.push({
|
topSuite.addExpectationResult(false, {
|
||||||
passed: false,
|
passed: false,
|
||||||
globalErrorType: 'load',
|
globalErrorType: 'load',
|
||||||
message: error ? error.message : event.message,
|
message: error.message,
|
||||||
stack: error && error.stack,
|
stack: error.stack,
|
||||||
filename: event && event.filename,
|
filename: error.filename,
|
||||||
lineno: event && event.lineno
|
lineno: error.lineno
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -240,7 +242,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
expectationResult.globalErrorType = 'lateError';
|
expectationResult.globalErrorType = 'lateError';
|
||||||
}
|
}
|
||||||
|
|
||||||
r.result.failedExpectations.push(expectationResult);
|
r.addExpectationResult(false, expectationResult);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -400,6 +402,14 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
this.execute = async function(runablesToRun) {
|
this.execute = async function(runablesToRun) {
|
||||||
installGlobalErrors();
|
installGlobalErrors();
|
||||||
|
|
||||||
|
// Karma incorrectly loads jasmine-core as an ES module. It isn't one,
|
||||||
|
// and we don't test that configuration. Warn about it.
|
||||||
|
if (j$.private.loadedAsBrowserEsm) {
|
||||||
|
this.deprecated(
|
||||||
|
"jasmine-core isn't an ES module but it was loaded as one. This is not a supported configuration."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (parallelLoadingState) {
|
if (parallelLoadingState) {
|
||||||
validateConfigForParallel();
|
validateConfigForParallel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().ExceptionFormatter = function(j$) {
|
getJasmineRequireObj().ExceptionFormatter = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
const ignoredProperties = [
|
const ignoredProperties = [
|
||||||
'name',
|
'name',
|
||||||
'message',
|
'message',
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Expectation = function(j$) {
|
getJasmineRequireObj().Expectation = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Matchers that come with Jasmine out of the box.
|
* Matchers that come with Jasmine out of the box.
|
||||||
* @namespace matchers
|
* @namespace matchers
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().ExpectationFilterChain = function() {
|
getJasmineRequireObj().ExpectationFilterChain = function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function ExpectationFilterChain(maybeFilter, prev) {
|
function ExpectationFilterChain(maybeFilter, prev) {
|
||||||
this.filter_ = maybeFilter;
|
this.filter_ = maybeFilter;
|
||||||
this.prev_ = prev;
|
this.prev_ = prev;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Expector = function(j$) {
|
getJasmineRequireObj().Expector = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function Expector(options) {
|
function Expector(options) {
|
||||||
this.matchersUtil = options.matchersUtil || {
|
this.matchersUtil = options.matchersUtil || {
|
||||||
buildFailureMessage: function() {}
|
buildFailureMessage: function() {}
|
||||||
|
|||||||
+36
-26
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().GlobalErrors = function(j$) {
|
getJasmineRequireObj().GlobalErrors = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class GlobalErrors {
|
class GlobalErrors {
|
||||||
#getConfig;
|
#getConfig;
|
||||||
#adapter;
|
#adapter;
|
||||||
@@ -40,13 +42,6 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
|
|||||||
this.#adapter.uninstall();
|
this.#adapter.uninstall();
|
||||||
}
|
}
|
||||||
|
|
||||||
// The listener at the top of the stack will be called with two arguments:
|
|
||||||
// the error and the event. Either of them may be falsy.
|
|
||||||
// The error will normally be provided, but will be falsy in the case of
|
|
||||||
// some browser load-time errors. The event will normally be provided in
|
|
||||||
// browsers but will be falsy in Node.
|
|
||||||
// Listeners that are pushed after spec files have been loaded should be
|
|
||||||
// able to just use the error parameter.
|
|
||||||
pushListener(listener) {
|
pushListener(listener) {
|
||||||
this.#handlers.push(listener);
|
this.#handlers.push(listener);
|
||||||
}
|
}
|
||||||
@@ -78,29 +73,23 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reportUnhandledRejections() {
|
reportUnhandledRejections() {
|
||||||
for (const {
|
for (const { reason } of this.#pendingUnhandledRejections.values()) {
|
||||||
reason,
|
this.#dispatchError(reason);
|
||||||
event
|
|
||||||
} of this.#pendingUnhandledRejections.values()) {
|
|
||||||
this.#dispatchError(reason, event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#pendingUnhandledRejections.clear();
|
this.#pendingUnhandledRejections.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Either error or event may be undefined
|
#onUncaughtException(error) {
|
||||||
#onUncaughtException(error, event) {
|
this.#dispatchError(error);
|
||||||
this.#dispatchError(error, event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// event or promise may be undefined
|
// promise may be undefined
|
||||||
// event is passed through for backwards compatibility reasons. It's probably
|
#onUnhandledRejection(reason, promise) {
|
||||||
// unnecessary, but user code could depend on it.
|
|
||||||
#onUnhandledRejection(reason, promise, event) {
|
|
||||||
if (this.#detectLateRejectionHandling() && promise) {
|
if (this.#detectLateRejectionHandling() && promise) {
|
||||||
this.#pendingUnhandledRejections.set(promise, { reason, event });
|
this.#pendingUnhandledRejections.set(promise, { reason });
|
||||||
} else {
|
} else {
|
||||||
this.#dispatchError(reason, event);
|
this.#dispatchError(reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,8 +101,7 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
|
|||||||
this.#pendingUnhandledRejections.delete(promise);
|
this.#pendingUnhandledRejections.delete(promise);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Either error or event may be undefined
|
#dispatchError(error) {
|
||||||
#dispatchError(error, event) {
|
|
||||||
if (this.#overrideHandler) {
|
if (this.#overrideHandler) {
|
||||||
// See discussion of spyOnGlobalErrorsAsync in base.js
|
// See discussion of spyOnGlobalErrorsAsync in base.js
|
||||||
this.#overrideHandler(error);
|
this.#overrideHandler(error);
|
||||||
@@ -123,7 +111,7 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
|
|||||||
const handler = this.#handlers[this.#handlers.length - 1];
|
const handler = this.#handlers[this.#handlers.length - 1];
|
||||||
|
|
||||||
if (handler) {
|
if (handler) {
|
||||||
handler(error, event);
|
handler(error);
|
||||||
} else {
|
} else {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
@@ -140,7 +128,7 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
|
|||||||
constructor(global, dispatch) {
|
constructor(global, dispatch) {
|
||||||
this.#global = global;
|
this.#global = global;
|
||||||
this.#dispatch = dispatch;
|
this.#dispatch = dispatch;
|
||||||
this.#onError = event => dispatch.onUncaughtException(event.error, event);
|
this.#onError = this.#errorHandler.bind(this);
|
||||||
this.#onUnhandledRejection = this.#unhandledRejectionHandler.bind(this);
|
this.#onUnhandledRejection = this.#unhandledRejectionHandler.bind(this);
|
||||||
this.#onRejectionHandled = this.#rejectionHandledHandler.bind(this);
|
this.#onRejectionHandled = this.#rejectionHandledHandler.bind(this);
|
||||||
}
|
}
|
||||||
@@ -169,6 +157,28 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#errorHandler(event) {
|
||||||
|
let error = event.error;
|
||||||
|
|
||||||
|
// event.error isn't guaranteed to be present in all browser load-time
|
||||||
|
// error events.
|
||||||
|
if (!error) {
|
||||||
|
error = {
|
||||||
|
message: event.message,
|
||||||
|
stack: `@${event.filename}:${event.lineno}`
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.filename) {
|
||||||
|
// filename and lineno can be more convenient than stack when reporting
|
||||||
|
// things like syntax errors. Pass them along.
|
||||||
|
error.filename = event.filename;
|
||||||
|
error.lineno = event.lineno;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.#dispatch.onUncaughtException(error);
|
||||||
|
}
|
||||||
|
|
||||||
#unhandledRejectionHandler(event) {
|
#unhandledRejectionHandler(event) {
|
||||||
const jasmineMessage = 'Unhandled promise rejection: ' + event.reason;
|
const jasmineMessage = 'Unhandled promise rejection: ' + event.reason;
|
||||||
let reason;
|
let reason;
|
||||||
@@ -180,7 +190,7 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
|
|||||||
reason = jasmineMessage;
|
reason = jasmineMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#dispatch.onUnhandledRejection(reason, event.promise, event);
|
this.#dispatch.onUnhandledRejection(reason, event.promise);
|
||||||
}
|
}
|
||||||
|
|
||||||
#rejectionHandledHandler(event) {
|
#rejectionHandledHandler(event) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().JsApiReporter = function(j$) {
|
getJasmineRequireObj().JsApiReporter = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name jsApiReporter
|
* @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.
|
* @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.
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().MockDate = function(j$) {
|
getJasmineRequireObj().MockDate = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function MockDate(global) {
|
function MockDate(global) {
|
||||||
let currentTime = 0;
|
let currentTime = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().NeverSkipPolicy = function(j$) {
|
getJasmineRequireObj().NeverSkipPolicy = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function NeverSkipPolicy(queueableFns) {}
|
function NeverSkipPolicy(queueableFns) {}
|
||||||
|
|
||||||
NeverSkipPolicy.prototype.skipTo = function(lastRanFnIx) {
|
NeverSkipPolicy.prototype.skipTo = function(lastRanFnIx) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Order = function() {
|
getJasmineRequireObj().Order = function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function Order(options) {
|
function Order(options) {
|
||||||
this.random = 'random' in options ? options.random : true;
|
this.random = 'random' in options ? options.random : true;
|
||||||
const seed = (this.seed = options.seed || generateSeed());
|
const seed = (this.seed = options.seed || generateSeed());
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().makePrettyPrinter = function(j$) {
|
getJasmineRequireObj().makePrettyPrinter = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class SinglePrettyPrintRun {
|
class SinglePrettyPrintRun {
|
||||||
constructor(customObjectFormatters, pp) {
|
constructor(customObjectFormatters, pp) {
|
||||||
this.customObjectFormatters_ = customObjectFormatters;
|
this.customObjectFormatters_ = customObjectFormatters;
|
||||||
|
|||||||
+6
-15
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().QueueRunner = function(j$) {
|
getJasmineRequireObj().QueueRunner = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
let nextid = 1;
|
let nextid = 1;
|
||||||
|
|
||||||
function StopExecutionError() {}
|
function StopExecutionError() {}
|
||||||
@@ -77,8 +79,8 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QueueRunner.prototype.execute = function() {
|
QueueRunner.prototype.execute = function() {
|
||||||
this.handleFinalError = (error, event) => {
|
this.handleFinalError = error => {
|
||||||
this.onException(errorOrMsgForGlobalError(error, event));
|
this.onException(error);
|
||||||
};
|
};
|
||||||
this.globalErrors.pushListener(this.handleFinalError);
|
this.globalErrors.pushListener(this.handleFinalError);
|
||||||
this.run(0);
|
this.run(0);
|
||||||
@@ -108,8 +110,8 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|||||||
this.recordError_(iterativeIndex);
|
this.recordError_(iterativeIndex);
|
||||||
};
|
};
|
||||||
|
|
||||||
function handleError(error, event) {
|
function handleError(error) {
|
||||||
onException(errorOrMsgForGlobalError(error, event));
|
onException(error);
|
||||||
}
|
}
|
||||||
const cleanup = once(() => {
|
const cleanup = once(() => {
|
||||||
if (timeoutId !== void 0) {
|
if (timeoutId !== void 0) {
|
||||||
@@ -296,16 +298,5 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function errorOrMsgForGlobalError(error, event) {
|
|
||||||
// TODO: In cases where error is a string or undefined, the error message
|
|
||||||
// that gets sent to reporters will be `${message} thrown`, which could
|
|
||||||
// be improved to not say "thrown" when the cause wasn't necessarily
|
|
||||||
// an exception or to provide hints about throwing Errors rather than
|
|
||||||
// strings.
|
|
||||||
return (
|
|
||||||
error || (event && event.message) || 'Global error event with no message'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return QueueRunner;
|
return QueueRunner;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().RunableResources = function(j$) {
|
getJasmineRequireObj().RunableResources = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class RunableResources {
|
class RunableResources {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
this.byRunableId_ = {};
|
this.byRunableId_ = {};
|
||||||
|
|||||||
+6
-3
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Runner = function(j$) {
|
getJasmineRequireObj().Runner = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class Runner {
|
class Runner {
|
||||||
#topSuite;
|
#topSuite;
|
||||||
#getTotalSpecsDefined;
|
#getTotalSpecsDefined;
|
||||||
@@ -123,7 +125,7 @@ getJasmineRequireObj().Runner = function(j$) {
|
|||||||
this.#currentRunableTracker.popSuite();
|
this.#currentRunableTracker.popSuite();
|
||||||
let overallStatus, incompleteReason, incompleteCode;
|
let overallStatus, incompleteReason, incompleteCode;
|
||||||
|
|
||||||
if (hasFailures || this.#topSuite.result.failedExpectations.length > 0) {
|
if (hasFailures || this.#topSuite.hasOwnFailedExpectations()) {
|
||||||
overallStatus = 'failed';
|
overallStatus = 'failed';
|
||||||
} else if (this.#getFocusedRunables().length > 0) {
|
} else if (this.#getFocusedRunables().length > 0) {
|
||||||
overallStatus = 'incomplete';
|
overallStatus = 'incomplete';
|
||||||
@@ -137,6 +139,7 @@ getJasmineRequireObj().Runner = function(j$) {
|
|||||||
overallStatus = 'passed';
|
overallStatus = 'passed';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const topSuiteResult = this.#topSuite.doneEvent();
|
||||||
/**
|
/**
|
||||||
* Information passed to the {@link Reporter#jasmineDone} event.
|
* Information passed to the {@link Reporter#jasmineDone} event.
|
||||||
* @typedef JasmineDoneInfo
|
* @typedef JasmineDoneInfo
|
||||||
@@ -156,8 +159,8 @@ getJasmineRequireObj().Runner = function(j$) {
|
|||||||
incompleteReason: incompleteReason,
|
incompleteReason: incompleteReason,
|
||||||
incompleteCode: incompleteCode,
|
incompleteCode: incompleteCode,
|
||||||
order: orderForReporting(order),
|
order: orderForReporting(order),
|
||||||
failedExpectations: this.#topSuite.result.failedExpectations,
|
failedExpectations: topSuiteResult.failedExpectations,
|
||||||
deprecationWarnings: this.#topSuite.result.deprecationWarnings
|
deprecationWarnings: topSuiteResult.deprecationWarnings
|
||||||
};
|
};
|
||||||
this.#topSuite.reportedDone = true;
|
this.#topSuite.reportedDone = true;
|
||||||
await this.#reportDispatcher.jasmineDone(jasmineDoneInfo);
|
await this.#reportDispatcher.jasmineDone(jasmineDoneInfo);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().SkipAfterBeforeAllErrorPolicy = function(j$) {
|
getJasmineRequireObj().SkipAfterBeforeAllErrorPolicy = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function SkipAfterBeforeAllErrorPolicy(queueableFns) {
|
function SkipAfterBeforeAllErrorPolicy(queueableFns) {
|
||||||
this.queueableFns_ = queueableFns;
|
this.queueableFns_ = queueableFns;
|
||||||
this.skipping_ = false;
|
this.skipping_ = false;
|
||||||
|
|||||||
+58
-49
@@ -1,9 +1,12 @@
|
|||||||
getJasmineRequireObj().Spec = function(j$) {
|
getJasmineRequireObj().Spec = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class Spec {
|
class Spec {
|
||||||
#autoCleanClosures;
|
#autoCleanClosures;
|
||||||
#throwOnExpectationFailure;
|
#throwOnExpectationFailure;
|
||||||
#timer;
|
#timer;
|
||||||
#metadata;
|
#metadata;
|
||||||
|
#executionState;
|
||||||
|
|
||||||
constructor(attrs) {
|
constructor(attrs) {
|
||||||
this.expectationFactory = attrs.expectationFactory;
|
this.expectationFactory = attrs.expectationFactory;
|
||||||
@@ -35,28 +38,23 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
this.#throwOnExpectationFailure = !!attrs.throwOnExpectationFailure;
|
this.#throwOnExpectationFailure = !!attrs.throwOnExpectationFailure;
|
||||||
this.#timer = attrs.timer || new j$.Timer();
|
this.#timer = attrs.timer || new j$.Timer();
|
||||||
|
|
||||||
|
this.reset();
|
||||||
|
|
||||||
if (!this.queueableFn.fn) {
|
if (!this.queueableFn.fn) {
|
||||||
this.exclude();
|
this.exclude();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addExpectationResult(passed, data, isError) {
|
addExpectationResult(passed, data, isError) {
|
||||||
const expectationResult = j$.private.buildExpectationResult(data);
|
const expectationResult = j$.private.buildExpectationResult(data);
|
||||||
|
|
||||||
if (passed) {
|
if (passed) {
|
||||||
this.result.passedExpectations.push(expectationResult);
|
this.#executionState.passedExpectations.push(expectationResult);
|
||||||
} else {
|
} else {
|
||||||
if (this.reportedDone) {
|
if (this.reportedDone) {
|
||||||
this.onLateError(expectationResult);
|
this.onLateError(expectationResult);
|
||||||
} else {
|
} else {
|
||||||
this.result.failedExpectations.push(expectationResult);
|
this.#executionState.failedExpectations.push(expectationResult);
|
||||||
|
|
||||||
// TODO: refactor so that we don't need to override cached status
|
|
||||||
if (this.result.status) {
|
|
||||||
this.result.status = 'failed';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.#throwOnExpectationFailure && !isError) {
|
if (this.#throwOnExpectationFailure && !isError) {
|
||||||
@@ -66,8 +64,8 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getSpecProperty(key) {
|
getSpecProperty(key) {
|
||||||
this.result.properties = this.result.properties || {};
|
this.#executionState.properties = this.#executionState.properties || {};
|
||||||
return this.result.properties[key];
|
return this.#executionState.properties[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
setSpecProperty(key, value) {
|
setSpecProperty(key, value) {
|
||||||
@@ -76,8 +74,8 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
// Throw a better one now.
|
// Throw a better one now.
|
||||||
j$.private.util.assertReporterCloneable(key, 'Key');
|
j$.private.util.assertReporterCloneable(key, 'Key');
|
||||||
j$.private.util.assertReporterCloneable(value, 'Value');
|
j$.private.util.assertReporterCloneable(value, 'Value');
|
||||||
this.result.properties = this.result.properties || {};
|
this.#executionState.properties = this.#executionState.properties || {};
|
||||||
this.result.properties[key] = value;
|
this.#executionState.properties[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
executionStarted() {
|
executionStarted() {
|
||||||
@@ -85,34 +83,48 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
executionFinished(excluded, failSpecWithNoExp) {
|
executionFinished(excluded, failSpecWithNoExp) {
|
||||||
|
this.#executionState.dynamicallyExcluded = excluded;
|
||||||
|
this.#executionState.requireExpectations = failSpecWithNoExp;
|
||||||
|
|
||||||
if (this.#autoCleanClosures) {
|
if (this.#autoCleanClosures) {
|
||||||
this.queueableFn.fn = null;
|
this.queueableFn.fn = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.result.status = this.#status(excluded, failSpecWithNoExp);
|
this.#executionState.duration = this.#timer.elapsed();
|
||||||
this.result.duration = this.#timer.elapsed();
|
|
||||||
|
|
||||||
if (this.result.status !== 'failed') {
|
if (this.status() !== 'failed') {
|
||||||
this.result.debugLogs = null;
|
this.#executionState.debugLogs = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hadBeforeAllFailure() {
|
||||||
|
this.addExpectationResult(
|
||||||
|
false,
|
||||||
|
{
|
||||||
|
passed: false,
|
||||||
|
message:
|
||||||
|
'Not run because a beforeAll function failed. The ' +
|
||||||
|
'beforeAll failure will be reported on the suite that ' +
|
||||||
|
'caused it.'
|
||||||
|
},
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
this.result = {
|
this.#executionState = {
|
||||||
id: this.id,
|
|
||||||
description: this.description,
|
|
||||||
fullName: this.getFullName(),
|
|
||||||
parentSuiteId: this.parentSuiteId,
|
|
||||||
filename: this.filename,
|
|
||||||
failedExpectations: [],
|
failedExpectations: [],
|
||||||
passedExpectations: [],
|
passedExpectations: [],
|
||||||
deprecationWarnings: [],
|
deprecationWarnings: [],
|
||||||
pendingReason: this.excludeMessage || '',
|
pendingReason: this.excludeMessage || '',
|
||||||
duration: null,
|
duration: null,
|
||||||
properties: null,
|
properties: null,
|
||||||
debugLogs: null
|
debugLogs: null,
|
||||||
|
// TODO: better naming. Don't make 'excluded' mean two things.
|
||||||
|
dynamicallyExcluded: false,
|
||||||
|
requireExpectations: false,
|
||||||
|
markedPending: this.markedExcluding
|
||||||
};
|
};
|
||||||
this.markedPending = this.markedExcluding;
|
|
||||||
this.reportedDone = false;
|
this.reportedDone = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +141,7 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
* same call stack height as the originals. This property may be removed in
|
* same call stack height as the originals. This property may be removed in
|
||||||
* a future version unless there is enough user interest in keeping it.
|
* a future version unless there is enough user interest in keeping it.
|
||||||
* See {@link https://github.com/jasmine/jasmine/issues/2065}.
|
* See {@link https://github.com/jasmine/jasmine/issues/2065}.
|
||||||
* @since 6.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
return this.#commonEventFields();
|
return this.#commonEventFields();
|
||||||
}
|
}
|
||||||
@@ -155,24 +167,24 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
* @property {number} duration - The time in ms used by the spec execution, including any before/afterEach.
|
* @property {number} duration - The time in ms used by the spec execution, including any before/afterEach.
|
||||||
* @property {Object} properties - User-supplied properties, if any, that were set using {@link Env#setSpecProperty}
|
* @property {Object} properties - User-supplied properties, if any, that were set using {@link Env#setSpecProperty}
|
||||||
* @property {DebugLogEntry[]|null} debugLogs - Messages, if any, that were logged using {@link jasmine.debugLog} during a failing spec.
|
* @property {DebugLogEntry[]|null} debugLogs - Messages, if any, that were logged using {@link jasmine.debugLog} during a failing spec.
|
||||||
* @since 6.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
const event = {
|
const event = {
|
||||||
...this.#commonEventFields()
|
...this.#commonEventFields(),
|
||||||
|
status: this.status()
|
||||||
};
|
};
|
||||||
const toCopy = [
|
const toCopy = [
|
||||||
'failedExpectations',
|
'failedExpectations',
|
||||||
'passedExpectations',
|
'passedExpectations',
|
||||||
'deprecationWarnings',
|
'deprecationWarnings',
|
||||||
'pendingReason',
|
'pendingReason',
|
||||||
'status',
|
|
||||||
'duration',
|
'duration',
|
||||||
'properties',
|
'properties',
|
||||||
'debugLogs'
|
'debugLogs'
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const k of toCopy) {
|
for (const k of toCopy) {
|
||||||
event[k] = this.result[k];
|
event[k] = this.#executionState[k];
|
||||||
}
|
}
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
@@ -210,12 +222,16 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pend(message) {
|
pend(message) {
|
||||||
this.markedPending = true;
|
this.#executionState.markedPending = true;
|
||||||
if (message) {
|
if (message) {
|
||||||
this.result.pendingReason = message;
|
this.#executionState.pendingReason = message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get markedPending() {
|
||||||
|
return this.#executionState.markedPending;
|
||||||
|
}
|
||||||
|
|
||||||
// Like pend(), but pending state will survive reset().
|
// Like pend(), but pending state will survive reset().
|
||||||
// Useful for fit, xit, where pending state remains.
|
// Useful for fit, xit, where pending state remains.
|
||||||
exclude(message) {
|
exclude(message) {
|
||||||
@@ -226,15 +242,8 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
this.pend(message);
|
this.pend(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: ensure that all access to result goes through .getResult()
|
status() {
|
||||||
// so that the status is correct.
|
if (this.#executionState.dynamicallyExcluded) {
|
||||||
getResult() {
|
|
||||||
this.result.status = this.#status();
|
|
||||||
return this.result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#status(excluded, failSpecWithNoExpectations) {
|
|
||||||
if (excluded === true) {
|
|
||||||
return 'excluded';
|
return 'excluded';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,10 +252,10 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.result.failedExpectations.length > 0 ||
|
this.#executionState.failedExpectations.length > 0 ||
|
||||||
(failSpecWithNoExpectations &&
|
(this.#executionState.requireExpectations &&
|
||||||
this.result.failedExpectations.length +
|
this.#executionState.failedExpectations.length +
|
||||||
this.result.passedExpectations.length ===
|
this.#executionState.passedExpectations.length ===
|
||||||
0)
|
0)
|
||||||
) {
|
) {
|
||||||
return 'failed';
|
return 'failed';
|
||||||
@@ -263,14 +272,14 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
if (typeof deprecation === 'string') {
|
if (typeof deprecation === 'string') {
|
||||||
deprecation = { message: deprecation };
|
deprecation = { message: deprecation };
|
||||||
}
|
}
|
||||||
this.result.deprecationWarnings.push(
|
this.#executionState.deprecationWarnings.push(
|
||||||
j$.private.buildExpectationResult(deprecation)
|
j$.private.buildExpectationResult(deprecation)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
debugLog(msg) {
|
debugLog(msg) {
|
||||||
if (!this.result.debugLogs) {
|
if (!this.#executionState.debugLogs) {
|
||||||
this.result.debugLogs = [];
|
this.#executionState.debugLogs = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -279,7 +288,7 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
* @property {number} timestamp - The time when the entry was added, in
|
* @property {number} timestamp - The time when the entry was added, in
|
||||||
* milliseconds from the spec's start time
|
* milliseconds from the spec's start time
|
||||||
*/
|
*/
|
||||||
this.result.debugLogs.push({
|
this.#executionState.debugLogs.push({
|
||||||
message: msg,
|
message: msg,
|
||||||
timestamp: this.#timer.elapsed()
|
timestamp: this.#timer.elapsed()
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Spy = function(j$) {
|
getJasmineRequireObj().Spy = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
const nextOrder = (function() {
|
const nextOrder = (function() {
|
||||||
let order = 0;
|
let order = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().SpyFactory = function(j$) {
|
getJasmineRequireObj().SpyFactory = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function SpyFactory(
|
function SpyFactory(
|
||||||
getCustomStrategies,
|
getCustomStrategies,
|
||||||
getDefaultStrategyFn,
|
getDefaultStrategyFn,
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().SpyRegistry = function(j$) {
|
getJasmineRequireObj().SpyRegistry = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
const spyOnMsg = j$.private.formatErrorMsg(
|
const spyOnMsg = j$.private.formatErrorMsg(
|
||||||
'<spyOn>',
|
'<spyOn>',
|
||||||
'spyOn(<object>, <methodName>)'
|
'spyOn(<object>, <methodName>)'
|
||||||
@@ -81,7 +83,10 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
restoreStrategy = function() {
|
restoreStrategy = function() {
|
||||||
if (!delete obj[methodName]) {
|
try {
|
||||||
|
delete obj[methodName];
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
} catch (e) {
|
||||||
obj[methodName] = originalMethod;
|
obj[methodName] = originalMethod;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().SpyStrategy = function(j$) {
|
getJasmineRequireObj().SpyStrategy = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @interface SpyStrategy
|
* @interface SpyStrategy
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().StackTrace = function(j$) {
|
getJasmineRequireObj().StackTrace = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function StackTrace(error) {
|
function StackTrace(error) {
|
||||||
let lines = error.stack.split('\n');
|
let lines = error.stack.split('\n');
|
||||||
|
|
||||||
|
|||||||
+79
-39
@@ -1,9 +1,12 @@
|
|||||||
getJasmineRequireObj().Suite = function(j$) {
|
getJasmineRequireObj().Suite = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class Suite {
|
class Suite {
|
||||||
#reportedParentSuiteId;
|
#reportedParentSuiteId;
|
||||||
#throwOnExpectationFailure;
|
#throwOnExpectationFailure;
|
||||||
#autoCleanClosures;
|
#autoCleanClosures;
|
||||||
#timer;
|
#timer;
|
||||||
|
#result;
|
||||||
|
|
||||||
constructor(attrs) {
|
constructor(attrs) {
|
||||||
this.id = attrs.id;
|
this.id = attrs.id;
|
||||||
@@ -36,8 +39,8 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
// Throw a better one now.
|
// Throw a better one now.
|
||||||
j$.private.util.assertReporterCloneable(key, 'Key');
|
j$.private.util.assertReporterCloneable(key, 'Key');
|
||||||
j$.private.util.assertReporterCloneable(value, 'Value');
|
j$.private.util.assertReporterCloneable(value, 'Value');
|
||||||
this.result.properties = this.result.properties || {};
|
this.#result.properties = this.#result.properties || {};
|
||||||
this.result.properties[key] = value;
|
this.#result.properties[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFullName() {
|
getFullName() {
|
||||||
@@ -87,7 +90,7 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
endTimer() {
|
endTimer() {
|
||||||
this.result.duration = this.#timer.elapsed();
|
this.#result.duration = this.#timer.elapsed();
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanupBeforeAfter() {
|
cleanupBeforeAfter() {
|
||||||
@@ -100,26 +103,7 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
/**
|
this.#result = {
|
||||||
* @typedef SuiteResult
|
|
||||||
* @property {String} id - The unique id of this suite.
|
|
||||||
* @property {String} description - The description text passed to the {@link describe} that made this suite.
|
|
||||||
* @property {String} fullName - The full description including all ancestors of this suite.
|
|
||||||
* @property {String|null} parentSuiteId - The ID of the suite containing this suite, or null if this is not in another describe().
|
|
||||||
* @property {String} filename - Deprecated. The name of the file the suite was defined in.
|
|
||||||
* Note: The value may be incorrect if zone.js is installed or
|
|
||||||
* `describe`/`fdescribe`/`xdescribe` have been replaced with versions that
|
|
||||||
* don't maintain the same call stack height as the originals. This property
|
|
||||||
* may be removed in a future version unless there is enough user interest
|
|
||||||
* in keeping it. See {@link https://github.com/jasmine/jasmine/issues/2065}.
|
|
||||||
* @property {ExpectationResult[]} failedExpectations - The list of expectations that failed in an {@link afterAll} for this suite.
|
|
||||||
* @property {ExpectationResult[]} deprecationWarnings - The list of deprecation warnings that occurred on this suite.
|
|
||||||
* @property {String} status - Once the suite has completed, this string represents the pass/fail status of this suite.
|
|
||||||
* @property {number} duration - The time in ms for Suite execution, including any before/afterAll, before/afterEach.
|
|
||||||
* @property {Object} properties - User-supplied properties, if any, that were set using {@link Env#setSuiteProperty}
|
|
||||||
* @since 2.0.0
|
|
||||||
*/
|
|
||||||
this.result = {
|
|
||||||
id: this.id,
|
id: this.id,
|
||||||
description: this.description,
|
description: this.description,
|
||||||
fullName: this.getFullName(),
|
fullName: this.getFullName(),
|
||||||
@@ -137,6 +121,72 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
this.reportedDone = false;
|
this.reportedDone = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startedEvent() {
|
||||||
|
/**
|
||||||
|
* @typedef SuiteStartedEvent
|
||||||
|
* @property {String} id - The unique id of this suite.
|
||||||
|
* @property {String} description - The description text passed to the {@link describe} that made this suite.
|
||||||
|
* @property {String} fullName - The full description including all ancestors of this suite.
|
||||||
|
* @property {String|null} parentSuiteId - The ID of the suite containing this suite, or null if this is not in another describe().
|
||||||
|
* @property {String} filename - Deprecated. The name of the file the suite was defined in.
|
||||||
|
* Note: The value may be incorrect if zone.js is installed or
|
||||||
|
* `describe`/`fdescribe`/`xdescribe` have been replaced with versions that
|
||||||
|
* don't maintain the same call stack height as the originals. This property
|
||||||
|
* may be removed in a future version unless there is enough user interest
|
||||||
|
* in keeping it. See {@link https://github.com/jasmine/jasmine/issues/2065}.
|
||||||
|
* @since 6.0.0
|
||||||
|
*/
|
||||||
|
return this.#commonEventFields();
|
||||||
|
}
|
||||||
|
|
||||||
|
doneEvent() {
|
||||||
|
/**
|
||||||
|
* @typedef SuiteDoneEvent
|
||||||
|
* @property {String} id - The unique id of this suite.
|
||||||
|
* @property {String} description - The description text passed to the {@link describe} that made this suite.
|
||||||
|
* @property {String} fullName - The full description including all ancestors of this suite.
|
||||||
|
* @property {String|null} parentSuiteId - The ID of the suite containing this suite, or null if this is not in another describe().
|
||||||
|
* @property {String} filename - Deprecated. The name of the file the suite was defined in.
|
||||||
|
* Note: The value may be incorrect if zone.js is installed or
|
||||||
|
* `describe`/`fdescribe`/`xdescribe` have been replaced with versions that
|
||||||
|
* don't maintain the same call stack height as the originals. This property
|
||||||
|
* may be removed in a future version unless there is enough user interest
|
||||||
|
* in keeping it. See {@link https://github.com/jasmine/jasmine/issues/2065}.
|
||||||
|
* @property {ExpectationResult[]} failedExpectations - The list of expectations that failed in an {@link afterAll} for this suite.
|
||||||
|
* @property {ExpectationResult[]} deprecationWarnings - The list of deprecation warnings that occurred on this suite.
|
||||||
|
* @property {String} status - Once the suite has completed, this string represents the pass/fail status of this suite.
|
||||||
|
* @property {number} duration - The time in ms for Suite execution, including any before/afterAll, before/afterEach.
|
||||||
|
* @property {Object} properties - User-supplied properties, if any, that were set using {@link Env#setSuiteProperty}
|
||||||
|
* @since 2.0.0
|
||||||
|
*/
|
||||||
|
const event = {
|
||||||
|
...this.#commonEventFields(),
|
||||||
|
status: this.#status()
|
||||||
|
};
|
||||||
|
const toCopy = [
|
||||||
|
'failedExpectations',
|
||||||
|
'deprecationWarnings',
|
||||||
|
'duration',
|
||||||
|
'properties'
|
||||||
|
];
|
||||||
|
|
||||||
|
for (const k of toCopy) {
|
||||||
|
event[k] = this.#result[k];
|
||||||
|
}
|
||||||
|
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
|
||||||
|
#commonEventFields() {
|
||||||
|
return {
|
||||||
|
id: this.id,
|
||||||
|
description: this.description,
|
||||||
|
fullName: this.getFullName(),
|
||||||
|
parentSuiteId: this.#reportedParentSuiteId,
|
||||||
|
filename: this.filename
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
removeChildren() {
|
removeChildren() {
|
||||||
this.children = [];
|
this.children = [];
|
||||||
}
|
}
|
||||||
@@ -150,20 +200,15 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
return 'pending';
|
return 'pending';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.result.failedExpectations.length > 0) {
|
if (this.#result.failedExpectations.length > 0) {
|
||||||
return 'failed';
|
return 'failed';
|
||||||
} else {
|
} else {
|
||||||
return 'passed';
|
return 'passed';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getResult() {
|
hasOwnFailedExpectations() {
|
||||||
this.result.status = this.#status();
|
return this.#result.failedExpectations.length > 0;
|
||||||
return this.result;
|
|
||||||
}
|
|
||||||
|
|
||||||
canBeReentered() {
|
|
||||||
return this.beforeAllFns.length === 0 && this.afterAllFns.length === 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sharedUserContext() {
|
sharedUserContext() {
|
||||||
@@ -199,7 +244,7 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
if (this.reportedDone) {
|
if (this.reportedDone) {
|
||||||
this.onLateError(failedExpectation);
|
this.onLateError(failedExpectation);
|
||||||
} else {
|
} else {
|
||||||
this.result.failedExpectations.push(failedExpectation);
|
this.#result.failedExpectations.push(failedExpectation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,12 +282,7 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
if (this.reportedDone) {
|
if (this.reportedDone) {
|
||||||
this.onLateError(expectationResult);
|
this.onLateError(expectationResult);
|
||||||
} else {
|
} else {
|
||||||
this.result.failedExpectations.push(expectationResult);
|
this.#result.failedExpectations.push(expectationResult);
|
||||||
|
|
||||||
// TODO: refactor so that we don't need to override cached status
|
|
||||||
if (this.result.status) {
|
|
||||||
this.result.status = 'failed';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.#throwOnExpectationFailure) {
|
if (this.#throwOnExpectationFailure) {
|
||||||
@@ -254,7 +294,7 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
if (typeof deprecation === 'string') {
|
if (typeof deprecation === 'string') {
|
||||||
deprecation = { message: deprecation };
|
deprecation = { message: deprecation };
|
||||||
}
|
}
|
||||||
this.result.deprecationWarnings.push(
|
this.#result.deprecationWarnings.push(
|
||||||
j$.private.buildExpectationResult(deprecation)
|
j$.private.buildExpectationResult(deprecation)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().SuiteBuilder = function(j$) {
|
getJasmineRequireObj().SuiteBuilder = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class SuiteBuilder {
|
class SuiteBuilder {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
this.env_ = options.env;
|
this.env_ = options.env;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Timer = function() {
|
getJasmineRequireObj().Timer = function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
const defaultNow = (function(Date) {
|
const defaultNow = (function(Date) {
|
||||||
return function() {
|
return function() {
|
||||||
return new Date().getTime();
|
return new Date().getTime();
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().TreeProcessor = function(j$) {
|
getJasmineRequireObj().TreeProcessor = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
const defaultMin = Infinity;
|
const defaultMin = Infinity;
|
||||||
const defaultMax = 1 - Infinity;
|
const defaultMax = 1 - Infinity;
|
||||||
|
|
||||||
|
|||||||
+16
-31
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().TreeRunner = function(j$) {
|
getJasmineRequireObj().TreeRunner = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class TreeRunner {
|
class TreeRunner {
|
||||||
#executionTree;
|
#executionTree;
|
||||||
#setTimeout;
|
#setTimeout;
|
||||||
@@ -77,7 +79,7 @@ getJasmineRequireObj().TreeRunner = function(j$) {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
if (spec.result.status === 'failed') {
|
if (spec.status() === 'failed') {
|
||||||
specOverallDone(new j$.private.StopExecutionError('spec failed'));
|
specOverallDone(new j$.private.StopExecutionError('spec failed'));
|
||||||
} else {
|
} else {
|
||||||
specOverallDone();
|
specOverallDone();
|
||||||
@@ -109,7 +111,7 @@ getJasmineRequireObj().TreeRunner = function(j$) {
|
|||||||
const complete = {
|
const complete = {
|
||||||
fn(done) {
|
fn(done) {
|
||||||
spec.executionFinished(excluded, config.failSpecWithNoExpectations);
|
spec.executionFinished(excluded, config.failSpecWithNoExpectations);
|
||||||
resultCallback(spec.result, done);
|
resultCallback(spec.doneEvent(), done);
|
||||||
},
|
},
|
||||||
type: 'specCleanup'
|
type: 'specCleanup'
|
||||||
};
|
};
|
||||||
@@ -163,7 +165,7 @@ getJasmineRequireObj().TreeRunner = function(j$) {
|
|||||||
|
|
||||||
this.#runQueue({
|
this.#runQueue({
|
||||||
onComplete: maybeError => {
|
onComplete: maybeError => {
|
||||||
this.#suiteSegmentComplete(suite, suite.getResult(), () => {
|
this.#suiteSegmentComplete(suite, () => {
|
||||||
done(maybeError);
|
done(maybeError);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -200,11 +202,12 @@ getJasmineRequireObj().TreeRunner = function(j$) {
|
|||||||
#suiteSegmentStart(suite, next) {
|
#suiteSegmentStart(suite, next) {
|
||||||
this.#currentRunableTracker.pushSuite(suite);
|
this.#currentRunableTracker.pushSuite(suite);
|
||||||
this.#runableResources.initForRunable(suite.id, suite.parentSuite.id);
|
this.#runableResources.initForRunable(suite.id, suite.parentSuite.id);
|
||||||
this.#reportDispatcher.suiteStarted(suite.result).then(next);
|
this.#reportDispatcher.suiteStarted(suite.startedEvent()).then(next);
|
||||||
suite.startTimer();
|
suite.startTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
#suiteSegmentComplete(suite, result, next) {
|
#suiteSegmentComplete(suite, next) {
|
||||||
|
suite.endTimer();
|
||||||
const isTopSuite = suite === this.#executionTree.topSuite;
|
const isTopSuite = suite === this.#executionTree.topSuite;
|
||||||
|
|
||||||
if (!isTopSuite) {
|
if (!isTopSuite) {
|
||||||
@@ -220,15 +223,14 @@ getJasmineRequireObj().TreeRunner = function(j$) {
|
|||||||
this.#runableResources.clearForRunable(suite.id);
|
this.#runableResources.clearForRunable(suite.id);
|
||||||
this.#currentRunableTracker.popSuite();
|
this.#currentRunableTracker.popSuite();
|
||||||
|
|
||||||
if (result.status === 'failed') {
|
if (suite.doneEvent().status === 'failed') {
|
||||||
this.#hasFailures = true;
|
this.#hasFailures = true;
|
||||||
}
|
}
|
||||||
suite.endTimer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const finish = isTopSuite
|
const finish = isTopSuite
|
||||||
? next
|
? next
|
||||||
: () => this.#reportSuiteDone(suite, result, next);
|
: () => this.#reportSuiteDone(suite, next);
|
||||||
|
|
||||||
if (suite.hadBeforeAllFailure) {
|
if (suite.hadBeforeAllFailure) {
|
||||||
this.#reportChildrenOfBeforeAllFailure(suite).then(finish);
|
this.#reportChildrenOfBeforeAllFailure(suite).then(finish);
|
||||||
@@ -237,16 +239,16 @@ getJasmineRequireObj().TreeRunner = function(j$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#reportSuiteDone(suite, result, next) {
|
#reportSuiteDone(suite, next) {
|
||||||
suite.reportedDone = true;
|
suite.reportedDone = true;
|
||||||
this.#reportDispatcher.suiteDone(result).then(next);
|
this.#reportDispatcher.suiteDone(suite.doneEvent()).then(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
async #specComplete(spec) {
|
async #specComplete(spec) {
|
||||||
this.#runableResources.clearForRunable(spec.id);
|
this.#runableResources.clearForRunable(spec.id);
|
||||||
this.#currentRunableTracker.setCurrentSpec(null);
|
this.#currentRunableTracker.setCurrentSpec(null);
|
||||||
|
|
||||||
if (spec.result.status === 'failed') {
|
if (spec.status() === 'failed') {
|
||||||
this.#hasFailures = true;
|
this.#hasFailures = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,30 +263,13 @@ getJasmineRequireObj().TreeRunner = function(j$) {
|
|||||||
async #reportChildrenOfBeforeAllFailure(suite) {
|
async #reportChildrenOfBeforeAllFailure(suite) {
|
||||||
for (const child of suite.children) {
|
for (const child of suite.children) {
|
||||||
if (child instanceof j$.private.Suite) {
|
if (child instanceof j$.private.Suite) {
|
||||||
await this.#reportDispatcher.suiteStarted(child.result);
|
await this.#reportDispatcher.suiteStarted(child.startedEvent());
|
||||||
await this.#reportChildrenOfBeforeAllFailure(child);
|
await this.#reportChildrenOfBeforeAllFailure(child);
|
||||||
|
await this.#reportDispatcher.suiteDone(child.doneEvent());
|
||||||
// Marking the suite passed is consistent with how suites that
|
|
||||||
// contain failed specs but no suite-level failures are reported.
|
|
||||||
child.result.status = 'passed';
|
|
||||||
|
|
||||||
await this.#reportDispatcher.suiteDone(child.result);
|
|
||||||
} else {
|
} else {
|
||||||
/* a spec */
|
/* a spec */
|
||||||
await this.#reportDispatcher.specStarted(child.startedEvent());
|
await this.#reportDispatcher.specStarted(child.startedEvent());
|
||||||
|
child.hadBeforeAllFailure();
|
||||||
child.addExpectationResult(
|
|
||||||
false,
|
|
||||||
{
|
|
||||||
passed: false,
|
|
||||||
message:
|
|
||||||
'Not run because a beforeAll function failed. The ' +
|
|
||||||
'beforeAll failure will be reported on the suite that ' +
|
|
||||||
'caused it.'
|
|
||||||
},
|
|
||||||
true
|
|
||||||
);
|
|
||||||
child.result.status = 'failed';
|
|
||||||
await this.#reportSpecDone(child);
|
await this.#reportSpecDone(child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().UserContext = function(j$) {
|
getJasmineRequireObj().UserContext = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function UserContext() {}
|
function UserContext() {}
|
||||||
|
|
||||||
UserContext.fromExisting = function(oldContext) {
|
UserContext.fromExisting = function(oldContext) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Any = function(j$) {
|
getJasmineRequireObj().Any = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function Any(expectedObject) {
|
function Any(expectedObject) {
|
||||||
if (typeof expectedObject === 'undefined') {
|
if (typeof expectedObject === 'undefined') {
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Anything = function(j$) {
|
getJasmineRequireObj().Anything = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function Anything() {}
|
function Anything() {}
|
||||||
|
|
||||||
Anything.prototype.asymmetricMatch = function(other) {
|
Anything.prototype.asymmetricMatch = function(other) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().ArrayContaining = function(j$) {
|
getJasmineRequireObj().ArrayContaining = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function ArrayContaining(sample) {
|
function ArrayContaining(sample) {
|
||||||
this.sample = sample;
|
this.sample = sample;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().ArrayWithExactContents = function(j$) {
|
getJasmineRequireObj().ArrayWithExactContents = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function ArrayWithExactContents(sample) {
|
function ArrayWithExactContents(sample) {
|
||||||
this.sample = sample;
|
this.sample = sample;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Empty = function(j$) {
|
getJasmineRequireObj().Empty = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function Empty() {}
|
function Empty() {}
|
||||||
|
|
||||||
Empty.prototype.asymmetricMatch = function(other) {
|
Empty.prototype.asymmetricMatch = function(other) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Falsy = function(j$) {
|
getJasmineRequireObj().Falsy = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function Falsy() {}
|
function Falsy() {}
|
||||||
|
|
||||||
Falsy.prototype.asymmetricMatch = function(other) {
|
Falsy.prototype.asymmetricMatch = function(other) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Is = function(j$) {
|
getJasmineRequireObj().Is = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class Is {
|
class Is {
|
||||||
constructor(expected) {
|
constructor(expected) {
|
||||||
this.expected_ = expected;
|
this.expected_ = expected;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().MapContaining = function(j$) {
|
getJasmineRequireObj().MapContaining = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function MapContaining(sample) {
|
function MapContaining(sample) {
|
||||||
if (!j$.private.isMap(sample)) {
|
if (!j$.private.isMap(sample)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().NotEmpty = function(j$) {
|
getJasmineRequireObj().NotEmpty = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function NotEmpty() {}
|
function NotEmpty() {}
|
||||||
|
|
||||||
NotEmpty.prototype.asymmetricMatch = function(other) {
|
NotEmpty.prototype.asymmetricMatch = function(other) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().ObjectContaining = function(j$) {
|
getJasmineRequireObj().ObjectContaining = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function ObjectContaining(sample) {
|
function ObjectContaining(sample) {
|
||||||
this.sample = sample;
|
this.sample = sample;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().SetContaining = function(j$) {
|
getJasmineRequireObj().SetContaining = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function SetContaining(sample) {
|
function SetContaining(sample) {
|
||||||
if (!j$.private.isSet(sample)) {
|
if (!j$.private.isSet(sample)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().StringContaining = function(j$) {
|
getJasmineRequireObj().StringContaining = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function StringContaining(expected) {
|
function StringContaining(expected) {
|
||||||
if (!j$.private.isString(expected)) {
|
if (!j$.private.isString(expected)) {
|
||||||
throw new Error('Expected is not a String');
|
throw new Error('Expected is not a String');
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().StringMatching = function(j$) {
|
getJasmineRequireObj().StringMatching = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function StringMatching(expected) {
|
function StringMatching(expected) {
|
||||||
if (!j$.private.isString(expected) && !j$.private.isA('RegExp', expected)) {
|
if (!j$.private.isString(expected) && !j$.private.isA('RegExp', expected)) {
|
||||||
throw new Error('Expected is not a String or a RegExp');
|
throw new Error('Expected is not a String or a RegExp');
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().Truthy = function(j$) {
|
getJasmineRequireObj().Truthy = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function Truthy() {}
|
function Truthy() {}
|
||||||
|
|
||||||
Truthy.prototype.asymmetricMatch = function(other) {
|
Truthy.prototype.asymmetricMatch = function(other) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum object depth the pretty printer will print to.
|
* Maximum object depth the pretty printer will print to.
|
||||||
* Set this to a lower value to speed up pretty printing if you have large objects.
|
* Set this to a lower value to speed up pretty printing if you have large objects.
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
//TODO: expectation result may make more sense as a presentation of an expectation.
|
//TODO: expectation result may make more sense as a presentation of an expectation.
|
||||||
getJasmineRequireObj().buildExpectationResult = function(j$) {
|
getJasmineRequireObj().buildExpectationResult = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function buildExpectationResult(options) {
|
function buildExpectationResult(options) {
|
||||||
const exceptionFormatter = new j$.private.ExceptionFormatter();
|
const exceptionFormatter = new j$.private.ExceptionFormatter();
|
||||||
|
|
||||||
@@ -23,6 +25,13 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
|
|||||||
globalErrorType: options.globalErrorType
|
globalErrorType: options.globalErrorType
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (options.filename !== undefined) {
|
||||||
|
result.filename = options.filename;
|
||||||
|
}
|
||||||
|
if (options.lineno !== undefined) {
|
||||||
|
result.lineno = options.lineno;
|
||||||
|
}
|
||||||
|
|
||||||
if (!result.passed) {
|
if (!result.passed) {
|
||||||
if (options.error && !j$.private.isString(options.error)) {
|
if (options.error && !j$.private.isString(options.error)) {
|
||||||
if ('code' in options.error) {
|
if ('code' in options.error) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().errors = function() {
|
getJasmineRequireObj().errors = function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function ExpectationFailed() {}
|
function ExpectationFailed() {}
|
||||||
|
|
||||||
ExpectationFailed.prototype = new Error();
|
ExpectationFailed.prototype = new Error();
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().formatErrorMsg = function() {
|
getJasmineRequireObj().formatErrorMsg = function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function generateErrorMsg(domain, usage) {
|
function generateErrorMsg(domain, usage) {
|
||||||
const usageDefinition = usage ? '\nUsage: ' + usage : '';
|
const usageDefinition = usage ? '\nUsage: ' + usage : '';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().DiffBuilder = function(j$) {
|
getJasmineRequireObj().DiffBuilder = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class DiffBuilder {
|
class DiffBuilder {
|
||||||
constructor(config) {
|
constructor(config) {
|
||||||
this.prettyPrinter_ =
|
this.prettyPrinter_ =
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().MismatchTree = function(j$) {
|
getJasmineRequireObj().MismatchTree = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
To be able to apply custom object formatters at all possible levels of an
|
To be able to apply custom object formatters at all possible levels of an
|
||||||
object graph, DiffBuilder needs to be able to know not just where the
|
object graph, DiffBuilder needs to be able to know not just where the
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().NullDiffBuilder = function(j$) {
|
getJasmineRequireObj().NullDiffBuilder = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
return function() {
|
return function() {
|
||||||
return {
|
return {
|
||||||
withPath: function(_, block) {
|
withPath: function(_, block) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().ObjectPath = function(j$) {
|
getJasmineRequireObj().ObjectPath = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
class ObjectPath {
|
class ObjectPath {
|
||||||
constructor(components) {
|
constructor(components) {
|
||||||
this.components = components || [];
|
this.components = components || [];
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().toBePending = function(j$) {
|
getJasmineRequireObj().toBePending = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expect a promise to be pending, i.e. the promise is neither resolved nor rejected.
|
* Expect a promise to be pending, i.e. the promise is neither resolved nor rejected.
|
||||||
* @function
|
* @function
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().toBeRejected = function(j$) {
|
getJasmineRequireObj().toBeRejected = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expect a promise to be rejected.
|
* Expect a promise to be rejected.
|
||||||
* @function
|
* @function
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().toBeRejectedWith = function(j$) {
|
getJasmineRequireObj().toBeRejectedWith = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expect a promise to be rejected with a value equal to the expected, using deep equality comparison.
|
* Expect a promise to be rejected with a value equal to the expected, using deep equality comparison.
|
||||||
* @function
|
* @function
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().toBeRejectedWithError = function(j$) {
|
getJasmineRequireObj().toBeRejectedWithError = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expect a promise to be rejected with a value matched to the expected
|
* Expect a promise to be rejected with a value matched to the expected
|
||||||
* @function
|
* @function
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().toBeResolved = function(j$) {
|
getJasmineRequireObj().toBeResolved = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expect a promise to be resolved.
|
* Expect a promise to be resolved.
|
||||||
* @function
|
* @function
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().toBeResolvedTo = function(j$) {
|
getJasmineRequireObj().toBeResolvedTo = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expect a promise to be resolved to a value equal to the expected, using deep equality comparison.
|
* Expect a promise to be resolved to a value equal to the expected, using deep equality comparison.
|
||||||
* @function
|
* @function
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().MatchersUtil = function(j$) {
|
getJasmineRequireObj().MatchersUtil = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class MatchersUtil
|
* @class MatchersUtil
|
||||||
* @classdesc Utilities for use in implementing matchers.<br>
|
* @classdesc Utilities for use in implementing matchers.<br>
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().nothing = function() {
|
getJasmineRequireObj().nothing = function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link expect} nothing explicitly.
|
* {@link expect} nothing explicitly.
|
||||||
* @function
|
* @function
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().requireAsyncMatchers = function(jRequire, j$) {
|
getJasmineRequireObj().requireAsyncMatchers = function(jRequire, j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
const availableMatchers = [
|
const availableMatchers = [
|
||||||
'toBePending',
|
'toBePending',
|
||||||
'toBeResolved',
|
'toBeResolved',
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
|
getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
const availableMatchers = [
|
const availableMatchers = [
|
||||||
'nothing',
|
'nothing',
|
||||||
'toBe',
|
'toBe',
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().toBe = function(j$) {
|
getJasmineRequireObj().toBe = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link expect} the actual value to be `===` to the expected value.
|
* {@link expect} the actual value to be `===` to the expected value.
|
||||||
* @function
|
* @function
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().toBeCloseTo = function() {
|
getJasmineRequireObj().toBeCloseTo = function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link expect} the actual value to be within a specified precision of the expected value.
|
* {@link expect} the actual value to be within a specified precision of the expected value.
|
||||||
* @function
|
* @function
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().toBeDefined = function() {
|
getJasmineRequireObj().toBeDefined = function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link expect} the actual value to be defined. (Not `undefined`)
|
* {@link expect} the actual value to be defined. (Not `undefined`)
|
||||||
* @function
|
* @function
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().toBeFalse = function() {
|
getJasmineRequireObj().toBeFalse = function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link expect} the actual value to be `false`.
|
* {@link expect} the actual value to be `false`.
|
||||||
* @function
|
* @function
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user