@@ -75,15 +75,6 @@ define(['require', 'tv4', './build/eventhandling', './build/util'],
75
75
global . log = require ( './build/log' ) ;
76
76
global . Dropbox = require ( './build/dropbox' ) ;
77
77
global . RemoteStorage = require ( './build/remotestorage' ) . RemoteStorage ;
78
-
79
- global . Discover = function ( userAddress ) {
80
- var pending = Promise . defer ( ) ;
81
- if ( userAddress === "someone@somewhere" ) {
82
- pending . reject ( 'in this test, discovery fails for that address' ) ;
83
- }
84
- return pending . promise ;
85
- } ;
86
-
87
78
global . localStorage = { } ;
88
79
global . RemoteStorage . prototype . remote = new FakeRemote ( ) ;
89
80
test . done ( ) ;
@@ -93,7 +84,7 @@ define(['require', 'tv4', './build/eventhandling', './build/util'],
93
84
var remoteStorage = new RemoteStorage ( { cache : false , disableFeatures : [ 'WireClient' ] } ) ;
94
85
env . rs = remoteStorage ;
95
86
config . cordovaRedirectUri = undefined ;
96
- remoteStorage . on ( 'ready' , test . done ) ;
87
+ remoteStorage . on ( 'ready' , test . done ) ;
97
88
} ,
98
89
99
90
tests : [
@@ -145,7 +136,7 @@ define(['require', 'tv4', './build/eventhandling', './build/util'],
145
136
} ,
146
137
147
138
{
148
- desc : "#get #put #delete not emmitting Error when getting 200" ,
139
+ desc : "#get #put #delete not emitting Error when getting 200" ,
149
140
run : function ( env , test ) {
150
141
var success = true ;
151
142
var c = 0 ;
@@ -170,70 +161,6 @@ define(['require', 'tv4', './build/eventhandling', './build/util'],
170
161
}
171
162
} ,
172
163
173
- {
174
- desc : "#connect throws unauthorized when userAddress doesn't contain an @ or URL" ,
175
- run : function ( env , test ) {
176
- env . rs . on ( 'error' , function ( e ) {
177
- test . assert ( e instanceof RemoteStorage . DiscoveryError , true ) ;
178
- } ) ;
179
- env . rs . connect ( 'somestring' ) ;
180
- }
181
- } ,
182
-
183
- {
184
- desc : "#connect accepts URLs for the userAddress" ,
185
- run : function ( env , test ) {
186
- env . rs . on ( 'error' , function ( e ) {
187
- test . fail ( 'URL userAddress was not accepted.' ) ;
188
- } ) ;
189
-
190
- env . rs . remote = new FakeRemote ( false ) ;
191
- env . rs . remote . configure = function ( options ) {
192
- test . assert ( options . userAddress , 'https://personal.ho.st' ) ;
193
- }
194
- env . rs . connect ( 'https://personal.ho.st' ) ;
195
- }
196
- } ,
197
-
198
- {
199
- desc : "#connect adds missing https:// to URLs" ,
200
- run : function ( env , test ) {
201
- env . rs . on ( 'error' , function ( e ) {
202
- test . fail ( 'URL userAddress was not accepted.' ) ;
203
- } ) ;
204
-
205
- env . rs . remote = new FakeRemote ( false ) ;
206
- env . rs . remote . configure = function ( options ) {
207
- test . assert ( options . userAddress , 'https://personal.ho.st' ) ;
208
- }
209
- env . rs . connect ( 'personal.ho.st' ) ;
210
- }
211
- } ,
212
-
213
- {
214
- desc : "#connect sets the backend to remotestorage" ,
215
- run : function ( env , test ) {
216
- global . localStorage = {
217
- storage : { } ,
218
- setItem : function ( key , value ) {
219
- this . storage [ key ] = value ;
220
- } ,
221
- getItem : function ( key ) {
222
- return this . storage [ key ] ;
223
- } ,
224
- removeItem : function ( key ) {
225
- delete this . storage [ key ] ;
226
- }
227
- } ;
228
-
229
- env . rs = new RemoteStorage ( ) ;
230
- env . rs . remote = new FakeRemote ( false ) ;
231
-
232
- env . rs . connect ( '[email protected] ' ) ;
233
- test . assert ( localStorage . getItem ( 'remotestorage:backend' ) , 'remotestorage' ) ;
234
- }
235
- } ,
236
-
237
164
{
238
165
desc : "#reconnect with remotestorage backend clears the token and connects again" ,
239
166
run : function ( env , test ) {
@@ -401,30 +328,6 @@ define(['require', 'tv4', './build/eventhandling', './build/util'],
401
328
}
402
329
} ,
403
330
404
- {
405
- desc : "#connect throws DiscoveryError on empty href" ,
406
- run : function ( env , test ) {
407
- env . rs . on ( 'error' , function ( e ) {
408
- if ( e instanceof RemoteStorage . DiscoveryError ) {
409
- test . done ( ) ;
410
- }
411
- } ) ;
412
- env . rs . connect ( 'someone@somewhere' ) ;
413
- }
414
- } ,
415
-
416
- {
417
- desc : "#connect throws DiscoveryError on timeout of RemoteStorage.Discover" ,
418
- run : function ( env , test ) {
419
- config . discoveryTimeout = 500 ;
420
- env . rs . on ( 'error' , function ( e ) {
421
- test . assertAnd ( e instanceof RemoteStorage . DiscoveryError , true ) ;
422
- test . done ( ) ;
423
- } ) ;
424
- env . rs . connect ( "someone@timeout" ) ;
425
- }
426
- } ,
427
-
428
331
{
429
332
desc : "maxAge defaults to false when not connected" ,
430
333
run : function ( env , test ) {
0 commit comments