Skip to content

Commit 67945c8

Browse files
author
Mat Jones
committed
fix incorrectly named tests
1 parent 7c31cdb commit 67945c8

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

docs/interfaces/dotryconfig.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[andculturecode-javascript-core](../README.md)[DoTryConfig](dotryconfig.md)
2+
3+
# Interface: DoTryConfig
4+
5+
## Hierarchy
6+
7+
* **DoTryConfig**
8+
9+
## Index
10+
11+
### Properties
12+
13+
* [defaultErrorHandler](dotryconfig.md#optional-defaulterrorhandler)
14+
15+
## Properties
16+
17+
### `Optional` defaultErrorHandler
18+
19+
**defaultErrorHandler**? : *[CatchHandler](../README.md#catchhandler)‹any›*
20+
21+
*Defined in [src/types/do-try-types.ts:19](https://github.com/mrjones2014/AndcultureCode.JavaScript.Core/blob/7c31cdb/src/types/do-try-types.ts#L19)*
22+
23+
A default handler that will always run on error, if configured,
24+
even if a `catch()` does not exist in the call chain.
25+
This is useful for adding default error handling in the
26+
development environment, such as `console.error(err)`.

src/utilities/do-try.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe("do-try.ts", () => {
121121
});
122122

123123
describe("Do.configure", () => {
124-
it("When defaultErrorHandler configured and no catch() in call chain, then defaultErrorHandler is still executed", async () => {
124+
it("When defaultErrorHandler configured and catch() is in call chain, then defaultErrorHandler is still executed", async () => {
125125
// Arrange
126126
const defaultErrorHandler: CatchHandler<any> = jest.fn();
127127
Do.configure({ defaultErrorHandler });
@@ -140,7 +140,7 @@ describe("do-try.ts", () => {
140140
expect.assertions(2);
141141
});
142142

143-
it("When defaultErrorHandler configured and catch() is in call chain, the defaultErrorHandler is still executed", async () => {
143+
it("When defaultErrorHandler configured and no catch() is in call chain, the defaultErrorHandler is still executed", async () => {
144144
// Arrange
145145
const defaultErrorHandler: CatchHandler<any> = jest.fn();
146146
Do.configure({ defaultErrorHandler });
@@ -243,7 +243,7 @@ describe("do-try.ts", () => {
243243
});
244244

245245
describe("DoSync.configure", () => {
246-
it("When defaultErrorHandler configured and no catch() in call chain, then defaultErrorHandler is still executed", () => {
246+
it("When defaultErrorHandler configured and catch() in call chain, then defaultErrorHandler is still executed", () => {
247247
// Arrange
248248
const defaultErrorHandler: CatchHandler<any> = jest.fn();
249249
DoSync.configure({ defaultErrorHandler });
@@ -262,7 +262,7 @@ describe("do-try.ts", () => {
262262
expect(defaultErrorHandler).toHaveBeenCalled();
263263
});
264264

265-
it("When defaultErrorHandler configured and catch() is in call chain, the defaultErrorHandler is still executed", () => {
265+
it("When defaultErrorHandler configured and no catch() is in call chain, the defaultErrorHandler is still executed", () => {
266266
// Arrange
267267
const defaultErrorHandler: CatchHandler<any> = jest.fn();
268268
DoSync.configure({ defaultErrorHandler });

0 commit comments

Comments
 (0)