Skip to content

Commit

Permalink
Revert "Add jest tests"
Browse files Browse the repository at this point in the history
This reverts commit 7f37df9.
  • Loading branch information
MajorLift committed Nov 20, 2023
1 parent 9c4e824 commit 65b6827
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions packages/base-controller/src/RestrictedControllerMessenger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,6 @@ import * as sinon from 'sinon';
import { ControllerMessenger } from './ControllerMessenger';

describe('RestrictedControllerMessenger', () => {
it('should throw when initializing a RestrictedControllerMessenger with an internal action as an allowed action', () => {
type CountAction = {
type: 'CountController:count';
handler: (increment: number) => void;
};
const controllerMessenger = new ControllerMessenger<CountAction, never>();

expect(() => {
controllerMessenger.getRestricted({
name: 'CountController',
allowedActions: ['CountController:count'],
});
}).toThrow(
`Only allow listing external actions not prefixed by 'CountController:'`,
);
});

it('should throw when initializing a RestrictedControllerMessenger with an internal event as an allowed event', () => {
type MessageEvent = {
type: 'MessageController:message';
payload: [string];
};
const controllerMessenger = new ControllerMessenger<never, MessageEvent>();

expect(() => {
controllerMessenger.getRestricted({
name: 'MessageController',
allowedEvents: ['MessageController:message'],
});
}).toThrow(
`Only allow listing external events not prefixed by 'MessageController:'`,
);
});

it('should allow registering and calling an action handler', () => {
type CountAction = {
type: 'CountController:count';
Expand Down

0 comments on commit 65b6827

Please sign in to comment.