unexpected
Advanced tools
Comparing version 11.2.0 to 11.3.0
@@ -1556,3 +1556,2 @@ var createStandardErrorMessage = require('./createStandardErrorMessage'); | ||
if (result.isPending()) { | ||
this.notifyPendingPromise(result); | ||
result = result.then(undefined, function (e) { | ||
@@ -1564,2 +1563,3 @@ if (e && e._isUnexpected && context.level === 0) { | ||
}); | ||
this.notifyPendingPromise(result); | ||
} | ||
@@ -1726,2 +1726,7 @@ } else { | ||
this._assertTopLevelExpect(); | ||
if (this._frozen) { | ||
throw new Error( | ||
'Cannot install a hook into a frozen instance, please run .clone() first' | ||
); | ||
} | ||
this._expect = fn(this._expect.bind(this)); | ||
@@ -1728,0 +1733,0 @@ }; |
@@ -21,3 +21,6 @@ /* global afterEach, jasmine */ | ||
return ( | ||
promise.isPending() || (promise.isRejected() && promise.reason().uncaught) | ||
!promise._fulfillmentHandler0 && | ||
!promise._rejectionHandler0 && | ||
!promise._receiver0 && | ||
(promise.isPending() || (promise.isRejected() && promise.reason().uncaught)) | ||
); | ||
@@ -24,0 +27,0 @@ } |
@@ -211,2 +211,8 @@ var utils = require('./utils'); | ||
expect.addStyle('diffLinesOmitted', function(lineCount) { | ||
this.jsComment( | ||
("... " + lineCount + " line" + (lineCount === 1 ? '' : 's') + " omitted ...") | ||
); | ||
}); | ||
expect.addStyle('removedHighlight', function(content) { | ||
@@ -459,3 +465,48 @@ this.alt({ | ||
} else { | ||
this.stringDiffFragment(' ', value, 'text'); | ||
var horizon = 3; | ||
if (index === diffLines.length - 1 && part.count > horizon) { | ||
this.stringDiffFragment( | ||
' ', | ||
value | ||
.split('\n') | ||
.slice(0, horizon) | ||
.join('\n'), | ||
'text' | ||
) | ||
.nl() | ||
.diffLinesOmitted(part.count - horizon); | ||
} else if (index === 0 && part.count > horizon) { | ||
this.diffLinesOmitted(part.count - horizon) | ||
.nl() | ||
.stringDiffFragment( | ||
' ', | ||
value | ||
.split('\n') | ||
.slice(-horizon) | ||
.join('\n'), | ||
'text' | ||
); | ||
} else if (part.count > 2 * horizon) { | ||
this.stringDiffFragment( | ||
' ', | ||
value | ||
.split('\n') | ||
.slice(0, horizon) | ||
.join('\n'), | ||
'text' | ||
) | ||
.nl() | ||
.diffLinesOmitted(part.count - 2 * horizon) | ||
.nl() | ||
.stringDiffFragment( | ||
' ', | ||
value | ||
.split('\n') | ||
.slice(-horizon) | ||
.join('\n'), | ||
'text' | ||
); | ||
} else { | ||
this.stringDiffFragment(' ', value, 'text'); | ||
} | ||
} | ||
@@ -462,0 +513,0 @@ if (endsWithNewline) { |
@@ -1301,3 +1301,3 @@ var utils = require('./utils'); | ||
}, | ||
diffLimit: 4096, | ||
diffLimit: 65536, | ||
diff: function diff(actual, expected, output, diff$1, inspect) { | ||
@@ -1304,0 +1304,0 @@ if (Math.max(actual.length, expected.length) > this.diffLimit) { |
@@ -1472,3 +1472,2 @@ const createStandardErrorMessage = require('./createStandardErrorMessage'); | ||
if (result.isPending()) { | ||
this.notifyPendingPromise(result); | ||
result = result.then(undefined, e => { | ||
@@ -1480,2 +1479,3 @@ if (e && e._isUnexpected && context.level === 0) { | ||
}); | ||
this.notifyPendingPromise(result); | ||
} | ||
@@ -1635,2 +1635,7 @@ } else { | ||
this._assertTopLevelExpect(); | ||
if (this._frozen) { | ||
throw new Error( | ||
'Cannot install a hook into a frozen instance, please run .clone() first' | ||
); | ||
} | ||
this._expect = fn(this._expect.bind(this)); | ||
@@ -1637,0 +1642,0 @@ }; |
@@ -21,3 +21,6 @@ /* global afterEach, jasmine */ | ||
return ( | ||
promise.isPending() || (promise.isRejected() && promise.reason().uncaught) | ||
!promise._fulfillmentHandler0 && | ||
!promise._rejectionHandler0 && | ||
!promise._receiver0 && | ||
(promise.isPending() || (promise.isRejected() && promise.reason().uncaught)) | ||
); | ||
@@ -24,0 +27,0 @@ } |
@@ -205,2 +205,8 @@ const utils = require('./utils'); | ||
expect.addStyle('diffLinesOmitted', function(lineCount) { | ||
this.jsComment( | ||
`... ${lineCount} line${lineCount === 1 ? '' : 's'} omitted ...` | ||
); | ||
}); | ||
expect.addStyle('removedHighlight', function(content) { | ||
@@ -444,3 +450,48 @@ this.alt({ | ||
} else { | ||
this.stringDiffFragment(' ', value, 'text'); | ||
const horizon = 3; | ||
if (index === diffLines.length - 1 && part.count > horizon) { | ||
this.stringDiffFragment( | ||
' ', | ||
value | ||
.split('\n') | ||
.slice(0, horizon) | ||
.join('\n'), | ||
'text' | ||
) | ||
.nl() | ||
.diffLinesOmitted(part.count - horizon); | ||
} else if (index === 0 && part.count > horizon) { | ||
this.diffLinesOmitted(part.count - horizon) | ||
.nl() | ||
.stringDiffFragment( | ||
' ', | ||
value | ||
.split('\n') | ||
.slice(-horizon) | ||
.join('\n'), | ||
'text' | ||
); | ||
} else if (part.count > 2 * horizon) { | ||
this.stringDiffFragment( | ||
' ', | ||
value | ||
.split('\n') | ||
.slice(0, horizon) | ||
.join('\n'), | ||
'text' | ||
) | ||
.nl() | ||
.diffLinesOmitted(part.count - 2 * horizon) | ||
.nl() | ||
.stringDiffFragment( | ||
' ', | ||
value | ||
.split('\n') | ||
.slice(-horizon) | ||
.join('\n'), | ||
'text' | ||
); | ||
} else { | ||
this.stringDiffFragment(' ', value, 'text'); | ||
} | ||
} | ||
@@ -447,0 +498,0 @@ if (endsWithNewline) { |
@@ -1288,3 +1288,3 @@ const utils = require('./utils'); | ||
}, | ||
diffLimit: 4096, | ||
diffLimit: 65536, | ||
diff(actual, expected, output, diff, inspect) { | ||
@@ -1291,0 +1291,0 @@ if (Math.max(actual.length, expected.length) > this.diffLimit) { |
{ | ||
"name": "unexpected", | ||
"version": "11.2.0", | ||
"version": "11.3.0", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -21,3 +21,3 @@ "keywords": [ | ||
"update-examples": "generate-site --require ./bootstrap-unexpected-markdown.js --update-examples", | ||
"preversion": "test -n \"${IS_MAKE_RELEASE}\" || (echo Please run make release instead && exit 1)" | ||
"version": "(test -n \"${IS_MAKE_RELEASE}\" || (echo Please run make release instead && exit 1)) && offline-github-changelog --next=${npm_package_version} > CHANGELOG.md && git add CHANGELOG.md" | ||
}, | ||
@@ -50,16 +50,16 @@ "main": "./build/lib/index.js", | ||
"istanbul": "^0.4.5", | ||
"jasmine": "~3.3.1", | ||
"jasmine": "~3.4.0", | ||
"jasmine-core": "^3.1.0", | ||
"jest": "^24.4.0", | ||
"karma": "4.0.1", | ||
"karma-browserstack-launcher": "1.4.0", | ||
"karma": "4.1.0", | ||
"karma-browserstack-launcher": "1.5.1", | ||
"karma-chrome-launcher": "2.2.0", | ||
"karma-mocha": "1.3.0", | ||
"minimist": "^1.2.0", | ||
"mocha": "^5.2.0", | ||
"mocha": "^6.1.2", | ||
"mocha-slow-reporter": "^*", | ||
"node-version-check": "^2.2.0", | ||
"nyc": "^13.0.1", | ||
"offline-github-changelog": "^1.2.0", | ||
"prettier": "~1.16.0", | ||
"nyc": "^14.0.0", | ||
"offline-github-changelog": "^1.6.1", | ||
"prettier": "~1.17.0", | ||
"rollup": "^1.0.1", | ||
@@ -91,6 +91,12 @@ "rollup-plugin-commonjs": "^9.1.0", | ||
], | ||
"setupTestFrameworkScriptFile": "<rootDir>/test/common.js", | ||
"setupFilesAfterEnv": [ | ||
"<rootDir>/test/common.js" | ||
], | ||
"testMatch": [ | ||
"<rootDir>/test/**.spec.js" | ||
"<rootDir>/test/*.spec.js", | ||
"<rootDir>/test/**/*.spec.js" | ||
], | ||
"testPathIgnorePatterns": [ | ||
"<rootDir>/test/external.spec.js" | ||
], | ||
"testURL": "http://localhost/", | ||
@@ -97,0 +103,0 @@ "transformIgnorePatterns": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
1889462
15635