Skip to content

Commit 16e2f5c

Browse files
author
Dustin Cleveland
committed
Replace tests using .bind() with arrow functions so that parameters are passed as method arguments instead of setting 'this'.
1 parent 1017647 commit 16e2f5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/angular2-pubsub.service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('PubSubService', (): void => {
1212

1313
describe('$sub', (): void => {
1414
it('should throw an error when event is falsy', (): void => {
15-
expect(pubService.$sub.bind(undefined)).toThrow();
15+
expect(() => pubService.$sub(undefined)).toThrow();
1616
});
1717

1818
it('should return an observable when there is no callback', (): void => {
@@ -30,7 +30,7 @@ describe('PubSubService', (): void => {
3030

3131
describe('$pub', (): void => {
3232
it('should throw an error when event is falsy', (): void => {
33-
expect(pubService.$pub.bind(undefined)).toThrow();
33+
expect(() => pubService.$pub(undefined)).toThrow();
3434
});
3535

3636
it('should do nothing when an event is not registered', (): void => {

0 commit comments

Comments
 (0)