1
1
function flushRavenState ( ) {
2
- authQueryString = undefined ;
3
2
hasJSON = ! isUndefined ( window . JSON ) ;
4
3
lastCapturedException = undefined ;
5
4
lastEventId = undefined ;
@@ -360,14 +359,6 @@ describe('globals', function() {
360
359
} ) ;
361
360
} ) ;
362
361
363
- describe ( 'setAuthQueryString' , function ( ) {
364
- it ( 'should return a properly formatted string and cache it' , function ( ) {
365
- var expected = '?sentry_version=4&sentry_client=raven-js/<%= pkg.version %>&sentry_key=abc' ;
366
- setAuthQueryString ( ) ;
367
- assert . strictEqual ( authQueryString , expected ) ;
368
- } ) ;
369
- } ) ;
370
-
371
362
describe ( 'parseDSN' , function ( ) {
372
363
it ( 'should do what it advertises' , function ( ) {
373
364
var pieces = parseDSN ( 'http://[email protected] :80/2' ) ;
@@ -1129,7 +1120,6 @@ describe('globals', function() {
1129
1120
} ) ;
1130
1121
1131
1122
globalServer = 'http://localhost/store/' ;
1132
- authQueryString = '?lol'
1133
1123
1134
1124
globalOptions = {
1135
1125
projectId : 2 ,
@@ -1141,7 +1131,7 @@ describe('globals', function() {
1141
1131
var args = window . makeRequest . lastCall . args ;
1142
1132
assert . equal ( args . length , 1 ) ;
1143
1133
var opts = args [ 0 ] ;
1144
- assert . equal ( opts . url , 'http://localhost/store/?lol ' ) ;
1134
+ assert . equal ( opts . url , 'http://localhost/store/' ) ;
1145
1135
assert . deepEqual ( opts . data , {
1146
1136
project : '2' ,
1147
1137
release : 'abc123' ,
@@ -1157,6 +1147,11 @@ describe('globals', function() {
1157
1147
foo : 'bar' ,
1158
1148
extra : { 'session:duration' : 100 } ,
1159
1149
} ) ;
1150
+ assert . deepEqual ( opts . auth , {
1151
+ sentry_client : 'raven-js/<%= pkg.version %>' ,
1152
+ sentry_key : 'abc' ,
1153
+ sentry_version : '4'
1154
+ } ) ;
1160
1155
assert . deepEqual ( opts . options , globalOptions ) ;
1161
1156
assert . isFunction ( opts . onSuccess ) ;
1162
1157
assert . isFunction ( opts . onError ) ;
@@ -1195,12 +1190,13 @@ describe('globals', function() {
1195
1190
1196
1191
it ( 'should load an Image' , function ( ) {
1197
1192
makeRequest ( {
1198
- url : 'http://localhost/?lol' ,
1193
+ url : 'http://localhost/' ,
1194
+ auth : { a : '1' , b : '2' } ,
1199
1195
data : { foo : 'bar' } ,
1200
1196
options : globalOptions
1201
1197
} ) ;
1202
1198
assert . equal ( imageCache . length , 1 ) ;
1203
- assert . equal ( imageCache [ 0 ] . src , 'http://localhost/?lol &sentry_data=%7B%22foo%22%3A%22bar%22%7D' ) ;
1199
+ assert . equal ( imageCache [ 0 ] . src , 'http://localhost/?a=1&b=2 &sentry_data=%7B%22foo%22%3A%22bar%22%7D' ) ;
1204
1200
} ) ;
1205
1201
1206
1202
it ( 'should populate crossOrigin based on globalOptions' , function ( ) {
@@ -1209,6 +1205,7 @@ describe('globals', function() {
1209
1205
} ;
1210
1206
makeRequest ( {
1211
1207
url : globalServer ,
1208
+ auth : { lol : '1' } ,
1212
1209
data : { foo : 'bar' } ,
1213
1210
options : globalOptions
1214
1211
} ) ;
@@ -1222,6 +1219,7 @@ describe('globals', function() {
1222
1219
} ;
1223
1220
makeRequest ( {
1224
1221
url : globalServer ,
1222
+ auth : { lol : '1' } ,
1225
1223
data : { foo : 'bar' } ,
1226
1224
options : globalOptions
1227
1225
} ) ;
@@ -1235,6 +1233,7 @@ describe('globals', function() {
1235
1233
} ;
1236
1234
makeRequest ( {
1237
1235
url : globalServer ,
1236
+ auth : { lol : '1' } ,
1238
1237
data : { foo : 'bar' } ,
1239
1238
options : globalOptions
1240
1239
} ) ;
@@ -1418,6 +1417,13 @@ describe('globals', function() {
1418
1417
] ) . source , 'a|b|a\\.b|d|[0-9]' ) ;
1419
1418
} ) ;
1420
1419
} ) ;
1420
+
1421
+ describe ( 'urlencode' , function ( ) {
1422
+ it ( 'should work' , function ( ) {
1423
+ assert . equal ( urlencode ( { } ) , '' ) ;
1424
+ assert . equal ( urlencode ( { 'foo' : 'bar' , 'baz' : '1 2' } ) , 'foo=bar&baz=1%202' ) ;
1425
+ } ) ;
1426
+ } ) ;
1421
1427
} ) ;
1422
1428
1423
1429
describe ( 'Raven (public API)' , function ( ) {
0 commit comments