-
-
Notifications
You must be signed in to change notification settings - Fork 769
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
136 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
docs/_releases/latest/examples/sandbox-configuration.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require("@fatso83/mini-mocha").install(); | ||
const sinon = require("sinon"); | ||
const { assert } = require("@sinonjs/referee"); | ||
|
||
it("should allow limiting the length of the assert.fake output", function () { | ||
const sb = sinon.createSandbox({ | ||
assertOptions: { | ||
shouldLimitAssertionLogs: true, | ||
assertionLogLimit: 10, | ||
}, | ||
}); | ||
const reallyLongErrorMessage = "a long string repeated 100 times".repeat( | ||
100, | ||
); | ||
|
||
assert.exception( | ||
() => { | ||
sb.assert.fail(reallyLongErrorMessage); | ||
}, | ||
{ | ||
message: "a long str", | ||
}, | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require("@fatso83/mini-mocha").install(); | ||
const sinon = require("sinon"); | ||
const { assert } = require("@sinonjs/referee"); | ||
|
||
it("should allow limiting the length of the assert.fake output", function () { | ||
const sb = sinon.createSandbox({ | ||
assertOptions: { | ||
shouldLimitAssertionLogs: true, | ||
assertionLogLimit: 10, | ||
}, | ||
}); | ||
const reallyLongErrorMessage = "a long string repeated 100 times".repeat( | ||
100, | ||
); | ||
|
||
assert.exception( | ||
() => { | ||
sb.assert.fail(reallyLongErrorMessage); | ||
}, | ||
{ | ||
message: "a long str", | ||
}, | ||
); | ||
}); |
Oops, something went wrong.