@@ -29,21 +29,10 @@ import { makeFakeApp } from './testing-utils/make-fake-app';
2929import { makeFakeSubscription } from './testing-utils/make-fake-subscription' ;
3030import { makeFakeSWReg } from './testing-utils/make-fake-sw-reg' ;
3131
32- const FAKE_SUBSCRIPTION = makeFakeSubscription ( ) ;
33- const EXAMPLE_TOKEN_SAVE = {
34- swScope : '/example-scope' ,
35- vapidKey : base64ToArrayBuffer (
36- 'BNJxw7sCGkGLOUP2cawBaBXRuWZ3lw_PmQMgreLVVvX_b' +
37- '4emEWVURkCF8fUTHEFe2xrEgTt5ilh5xD94v0pFe_I'
38- ) ,
39- fcmSenderId : '1234567' ,
40- fcmToken : 'qwerty' ,
41- fcmPushSet : '7654321' ,
42- endpoint : FAKE_SUBSCRIPTION . endpoint ,
43- auth : FAKE_SUBSCRIPTION . getKey ( 'auth' ) ! ,
44- p256dh : FAKE_SUBSCRIPTION . getKey ( 'p256dh' ) ! ,
45- createTime : Date . now ( )
46- } ;
32+ import { describe } from './testing-utils/messaging-test-runner' ;
33+
34+ let FAKE_SUBSCRIPTION : PushSubscription ;
35+ let EXAMPLE_TOKEN_SAVE : any ;
4736
4837describe ( 'Firebase Messaging > *Controller.deleteToken()' , ( ) => {
4938 let sandbox : sinon . SinonSandbox ;
@@ -71,6 +60,24 @@ describe('Firebase Messaging > *Controller.deleteToken()', () => {
7160 return registration ;
7261 }
7362
63+ before ( ( ) => {
64+ FAKE_SUBSCRIPTION = makeFakeSubscription ( ) ;
65+ EXAMPLE_TOKEN_SAVE = {
66+ swScope : '/example-scope' ,
67+ vapidKey : base64ToArrayBuffer (
68+ 'BNJxw7sCGkGLOUP2cawBaBXRuWZ3lw_PmQMgreLVVvX_b' +
69+ '4emEWVURkCF8fUTHEFe2xrEgTt5ilh5xD94v0pFe_I'
70+ ) ,
71+ fcmSenderId : '1234567' ,
72+ fcmToken : 'qwerty' ,
73+ fcmPushSet : '7654321' ,
74+ endpoint : FAKE_SUBSCRIPTION . endpoint ,
75+ auth : FAKE_SUBSCRIPTION . getKey ( 'auth' ) ! ,
76+ p256dh : FAKE_SUBSCRIPTION . getKey ( 'p256dh' ) ! ,
77+ createTime : Date . now ( )
78+ } ;
79+ } ) ;
80+
7481 beforeEach ( ( ) => {
7582 sandbox = sinon . sandbox . create ( ) ;
7683 app = makeFakeApp ( {
0 commit comments