Skip to content

Commit

Permalink
Replace new Error with YorkieError
Browse files Browse the repository at this point in the history
  • Loading branch information
gwbaik9717 committed Jul 28, 2024
1 parent 30330bb commit b4c330d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/helper/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { InitialChangeID } from '@yorkie-js-sdk/src/document/change/change_id';
import { CRDTRoot } from '@yorkie-js-sdk/src/document/crdt/root';
import { CRDTObject } from '@yorkie-js-sdk/src/document/crdt/object';
import { ElementRHT } from '@yorkie-js-sdk/src/document/crdt/element_rht';
import { Code, YorkieError } from '@yorkie-js-sdk/src/util/error';

export type Indexable = Record<string, any>;

Expand Down Expand Up @@ -66,9 +67,12 @@ export class EventCollector<E = string> {
resolve();
} else {
reject(
new Error(`event is not equal ${count}-
expected: ${JSON.stringify(event)},
actual: ${JSON.stringify(this.events[count - 1])}`),
new YorkieError(
Code.ErrInvalidArgument,
`event is not equal ${count}-
expected: ${JSON.stringify(event)},
actual: ${JSON.stringify(this.events[count - 1])}`,
),
);
}
return;
Expand Down

0 comments on commit b4c330d

Please sign in to comment.