Skip to content

Commit 7097cc4

Browse files
committed
tests: update
1 parent 2090524 commit 7097cc4

3 files changed

Lines changed: 19 additions & 12 deletions

File tree

__tests__/__snapshots__/serialize.test.ts.snap

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,18 @@ exports[`AssertionError 1`] = `
1212
}
1313
`;
1414
15-
exports[`CustomError 1`] = `
15+
exports[`CustomError with CustomError cause 1`] = `
1616
{
17-
"cause": ArrayContaining [
18-
ObjectContaining {
17+
"cause": [
18+
{
19+
"code": 2,
20+
"debug": {
21+
"woo1": "woo1",
22+
},
23+
"message": "previous",
24+
"name": "Error",
1925
"stack": Any<String>,
26+
"status": "UNKNOWN",
2027
},
2128
],
2229
"code": 2,

__tests__/serialize.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ test('URLError', async () => {
5252
});
5353
});
5454

55-
test('CustomError', () => {
55+
test('CustomError with CustomError cause', () => {
5656
const previousErr = new CustomError('previous').debug({ woo1: 'woo1' });
5757
const current = new CustomError('current', previousErr).debug({
5858
woo2: 'woo2',
@@ -63,11 +63,11 @@ test('CustomError', () => {
6363
const result = serializeError(current);
6464

6565
expect(result).toMatchSnapshot({
66-
cause: expect.arrayContaining<Partial<SerializedError>>([
67-
expect.objectContaining<Partial<SerializedError>>({
68-
stack: expect.any(String) as string,
69-
}) as Partial<SerializedError>,
70-
]) as Partial<SerializedError>[],
71-
stack: expect.any(String) as string,
66+
cause: [
67+
{
68+
stack: expect.any(String),
69+
},
70+
],
71+
stack: expect.any(String),
7272
});
7373
});

__tests__/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "./dist",
4+
"outDir": "./dist"
55
},
6-
"include": ["../lib"],
6+
"include": ["../lib", "."],
77
"exclude": ["./dist"]
88
}

0 commit comments

Comments
 (0)