-
-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Cleanup unimported setup & include test files * Remove redundant assign The 'assert' object is already present on the sandbox * fix(#2484): add assertion log limit * Document the existing sandbox and create-sandbox * Expose opts.assertOptions on createSandbox(opts) * Verify options are passed down * Remove needless accessors * Make test behavior oriented rather than implementation specific. --------- Co-authored-by: Spencer Goossens <[email protected]> Co-authored-by: Carl-Erik Kopseng <[email protected]>
- Loading branch information
1 parent
40caf21
commit f7d180c
Showing
7 changed files
with
131 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
{ | ||
"entry": ["lib/sinon.js", "lib/sinon-esm.js"], | ||
"extensions": [".js"], | ||
"ignorePatterns": ["**/node_modules/**"], | ||
"entry": [ | ||
"lib/sinon.js", | ||
"lib/sinon-esm.js", | ||
"test/**/*-test.js", | ||
"test/webworker/webworker-script.js", | ||
"test/webworker/webworker-support-assessment.js" | ||
], | ||
"extensions": [ | ||
".js" | ||
], | ||
"ignorePatterns": [ | ||
"**/node_modules/**" | ||
], | ||
"ignoreUnresolved": [], | ||
"ignoreUnimported": ["docs/**", "pkg/**", "test/**"], | ||
"ignoreUnimported": [ | ||
"docs/**", | ||
"pkg/**", | ||
"vendor/**/*", | ||
"test/es2015/check-esm-bundle-is-runnable.js" | ||
], | ||
"ignoreUnused": [] | ||
} |
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
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,22 @@ | ||
"use strict"; | ||
|
||
const createSandbox = require("../lib/sinon/create-sandbox"); | ||
const { assert } = require("@sinonjs/referee"); | ||
|
||
describe("create-sandbox", function () { | ||
it("can be configured to limit the error message length", function () { | ||
// Arrange & Act | ||
const sb = createSandbox({ | ||
assertOptions: { | ||
shouldLimitAssertionLogs: true, | ||
assertionLogLimit: 10, | ||
}, | ||
}); | ||
|
||
// Assert | ||
assert.exception( | ||
() => sb.assert.fail("1234567890--THIS SHOULD NOT SHOW--"), | ||
{ message: "1234567890" }, | ||
); | ||
}); | ||
}); |