Skip to content

Commit

Permalink
update helper
Browse files Browse the repository at this point in the history
  • Loading branch information
onury committed Nov 26, 2017
1 parent dc6853b commit d1e8900
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import { AccessControl } from '../src';
import { AccessControlError } from '../src/core';

const helper = {
expectACError(fn: any, errMsg?: string) {
Expand All @@ -14,6 +15,7 @@ const helper = {
fn();
} catch (err) {
expect(err instanceof AccessControl.Error).toEqual(true);
expect(err instanceof AccessControlError).toEqual(true);
expect(AccessControl.isAccessControlError(err)).toEqual(true);
expect(AccessControl.isACError(err)).toEqual(true); // alias test
if (errMsg) expect(err.message).toContain(errMsg);
Expand Down

0 comments on commit d1e8900

Please sign in to comment.