Redesigned moudule system
* Top level private APIs (e.g. jasmine.private.whatever) are no longer exposed * jasmineRequire is no longer exposed * core is self-booting * Globals are automatically created in browsers. (They can subsequently be removed by user code if desired.) * Globals are *not* automatically created in Node. An installGlobals function is exported instead. The jasmine package calls installGlobals unless configured not to do so. * In Node, the same instance is returned each time jasmine-core is imported. A reset function is exported. It effectively resets all state by discarding the env and creating a new one. This allows mulitple sequential runs within the same process to be independent of each other, but does not allow multiple concurrent runs. (That probably never worked anyway.) Fixes #2094
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
//TODO: expectation result may make more sense as a presentation of an expectation.
|
||||
getJasmineRequireObj().buildExpectationResult = function(j$) {
|
||||
getJasmineRequireObj().buildExpectationResult = function(j$, private$) {
|
||||
'use strict';
|
||||
|
||||
function buildExpectationResult(options) {
|
||||
const exceptionFormatter = new j$.private.ExceptionFormatter();
|
||||
const exceptionFormatter = new private$.ExceptionFormatter();
|
||||
|
||||
/**
|
||||
* Describes the result of evaluating an expectation
|
||||
@@ -33,7 +33,7 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
|
||||
}
|
||||
|
||||
if (!result.passed) {
|
||||
if (options.error && !j$.private.isString(options.error)) {
|
||||
if (options.error && !private$.isString(options.error)) {
|
||||
if ('code' in options.error) {
|
||||
result.code = options.error.code;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user