-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pass global config to subclass (#449)
2 parameters can be set by the caller ``` import Pusher from 'pusher-js; Pusher.logToConsole; ``` etc We need to pass these properties on to the subclass
- Loading branch information
James Lees
authored
Apr 27, 2020
1 parent
1753822
commit 139bcc3
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var Pusher = require('core/pusher').default; | ||
var PusherWithEncryption = require('core/pusher-with-encryption').default; | ||
|
||
describe('PusherWithEncryption', function() { | ||
it('should pass logToConsole config to parent class', function() { | ||
PusherWithEncryption.logToConsole = true; | ||
let pusher = new PusherWithEncryption('key'); | ||
expect(Pusher.logToConsole).toEqual(true); | ||
}); | ||
it('should pass log function to parent class', function() { | ||
let logFn = jasmine.createSpy('logFn'); | ||
PusherWithEncryption.log = logFn | ||
let pusher = new PusherWithEncryption('key'); | ||
expect(logFn).toHaveBeenCalled(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters