Skip to content

Commit 24d9eb6

Browse files
committed
WIP
1 parent 8a4a453 commit 24d9eb6

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

tests/index.test.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('index', () => {
9898
class SpecificError<T> extends AbstractError<T> {
9999
public static fromJSON<T extends Class<any>>(
100100
this: T,
101-
json: any
101+
json: any,
102102
): InstanceType<T> {
103103
if (
104104
typeof json !== 'object' ||
@@ -125,7 +125,7 @@ describe('index', () => {
125125
return obj;
126126
}
127127
}
128-
class UnknownError<T> extends AbstractError<T> { }
128+
class UnknownError<T> extends AbstractError<T> {}
129129
// AbstractError classes, these should be part of our application stack
130130
const customErrors = {
131131
AbstractError,
@@ -199,14 +199,11 @@ describe('index', () => {
199199
// Root key will be ''
200200
// Reaching here means the root JSON value is not a valid exception
201201
// Therefore UnknownError is only ever returned at the top-level
202-
return new UnknownError(
203-
'Unknown error JSON',
204-
{
205-
data: {
206-
json: value
207-
}
208-
}
209-
);
202+
return new UnknownError('Unknown error JSON', {
203+
data: {
204+
json: value,
205+
},
206+
});
210207
} else {
211208
// Other values will be returned as-is
212209
return value;
@@ -226,7 +223,7 @@ describe('index', () => {
226223
test('abstract on abstract on range', () => {
227224
const e = new AbstractError('msg1', {
228225
cause: new AbstractError('msg2', {
229-
cause: new RangeError('msg3')
226+
cause: new RangeError('msg3'),
230227
}),
231228
});
232229
const eJSONString = JSON.stringify(e, replacer);
@@ -240,7 +237,7 @@ describe('index', () => {
240237
});
241238
test('abstract on something random', () => {
242239
const e = new AbstractError('msg1', {
243-
cause: 'something random'
240+
cause: 'something random',
244241
});
245242
const eJSONString = JSON.stringify(e, replacer);
246243
const e_ = JSON.parse(eJSONString, reviver);

0 commit comments

Comments
 (0)