@@ -103,12 +103,12 @@ describe("VAPID", () => {
103103 } ) ;
104104} ) ;
105105
106- describe ( "WebPush.generateRequestDetails " , ( ) => {
106+ describe ( "WebPush.generateRequest " , ( ) => {
107107 it ( "builds a request without payload (Content-Length = 0)" , ( ) => {
108108 const wp = makeWebPush ( ) ;
109109 const sub : PushSubscription = { endpoint : "https://example.com/push" } ;
110110
111- const { endpoint, init } = wp . generateRequestDetails ( sub , null ) ;
111+ const { endpoint, init } = wp . generateRequest ( sub , null ) ;
112112
113113 expect ( endpoint ) . toBe ( sub . endpoint ) ;
114114 expect ( init . method ) . toBe ( "POST" ) ;
@@ -128,7 +128,7 @@ describe("WebPush.generateRequestDetails", () => {
128128 const sub = makeValidSubscription ( "https://example.com/push" ) ;
129129
130130 const payload = "hello" ;
131- const { init } = wp . generateRequestDetails ( sub , payload , {
131+ const { init } = wp . generateRequest ( sub , payload , {
132132 contentEncoding : SupportedContentEncoding . AES_128_GCM ,
133133 TTL : 60 ,
134134 urgency : SupportedUrgency . HIGH ,
@@ -177,7 +177,7 @@ describe("WebPush.generateRequestDetails", () => {
177177 // maxDataPerFullRecord = maxPlain - 1 = 1
178178 // payload length 2 should throw when allowMultipleRecords=false
179179 expect ( ( ) =>
180- wp . generateRequestDetails ( sub , Buffer . from ( "aa" ) , {
180+ wp . generateRequest ( sub , Buffer . from ( "aa" ) , {
181181 contentEncoding : SupportedContentEncoding . AES_128_GCM ,
182182 rs : MIN_RS , // 18
183183 allowMultipleRecords : false ,
@@ -189,7 +189,7 @@ describe("WebPush.generateRequestDetails", () => {
189189 const wp = makeWebPush ( ) ;
190190 const sub = makeValidSubscription ( "https://example.com/push" ) ;
191191
192- const { init } = wp . generateRequestDetails ( sub , Buffer . from ( "aa" ) , {
192+ const { init } = wp . generateRequest ( sub , Buffer . from ( "aa" ) , {
193193 contentEncoding : SupportedContentEncoding . AES_128_GCM ,
194194 rs : MIN_RS , // tiny
195195 allowMultipleRecords : true ,
@@ -205,13 +205,13 @@ describe("WebPush.generateRequestDetails", () => {
205205 const sub = makeValidSubscription ( "https://example.com/push" ) ;
206206
207207 expect ( ( ) =>
208- wp . generateRequestDetails ( sub , "hello" , {
208+ wp . generateRequest ( sub , "hello" , {
209209 topic : "not_valid!!!" ,
210210 } )
211211 ) . toThrow ( / T o p i c / i) ;
212212
213213 expect ( ( ) =>
214- wp . generateRequestDetails ( sub , "hello" , {
214+ wp . generateRequest ( sub , "hello" , {
215215 topic : "a" . repeat ( 33 ) ,
216216 } )
217217 ) . toThrow ( / T o p i c / i) ;
@@ -221,7 +221,7 @@ describe("WebPush.generateRequestDetails", () => {
221221 const wp = makeWebPush ( ) ;
222222 const sub = makeValidSubscription ( "https://android.googleapis.com/gcm/send/abc" ) ;
223223
224- const { init } = wp . generateRequestDetails ( sub , "hello" , {
224+ const { init } = wp . generateRequest ( sub , "hello" , {
225225 contentEncoding : SupportedContentEncoding . AES_128_GCM ,
226226 gcmAPIKey : "my-gcm" ,
227227 } ) ;
@@ -234,7 +234,7 @@ describe("WebPush.generateRequestDetails", () => {
234234 const wp = makeWebPush ( ) ;
235235 const sub = makeValidSubscription ( "https://fcm.googleapis.com/fcm/send/abc" ) ;
236236
237- const { init } = wp . generateRequestDetails ( sub , "hello" , {
237+ const { init } = wp . generateRequest ( sub , "hello" , {
238238 vapidDetails : null ,
239239 gcmAPIKey : "my-fcm-key" ,
240240 contentEncoding : SupportedContentEncoding . AES_128_GCM ,
0 commit comments