1
1
/* global JSData:true, JSDataHttp:true, sinon:true, chai:true */
2
+
2
3
before ( function ( ) {
3
4
var Test = this
5
+ Test . TEST_FETCH = false
4
6
Test . fail = function ( msg ) {
5
7
if ( msg instanceof Error ) {
6
8
console . log ( msg . stack )
@@ -14,7 +16,15 @@ before(function () {
14
16
}
15
17
Test . sinon = sinon
16
18
Test . JSData = JSData
19
+ Test . addAction = JSDataHttp . addAction
20
+ Test . addActions = JSDataHttp . addActions
17
21
Test . HttpAdapter = JSDataHttp . HttpAdapter
22
+
23
+ Test . store = new JSData . DataStore ( )
24
+ Test . adapter = new Test . HttpAdapter ( )
25
+
26
+ Test . store . registerAdapter ( 'http' , Test . adapter , { default : true } )
27
+
18
28
Test . User = new JSData . Mapper ( {
19
29
name : 'user'
20
30
} )
@@ -24,14 +34,13 @@ before(function () {
24
34
basePath : 'api'
25
35
} )
26
36
37
+ Test . User . registerAdapter ( 'http' , Test . adapter , { default : true } )
38
+ Test . Post . registerAdapter ( 'http' , Test . adapter , { default : true } )
27
39
console . log ( 'Testing against js-data ' + JSData . version . full )
28
40
} )
29
41
30
42
beforeEach ( function ( ) {
31
43
var Test = this
32
- Test . adapter = new Test . HttpAdapter ( )
33
- Test . User . registerAdapter ( 'http' , Test . adapter , { default : true } )
34
- Test . Post . registerAdapter ( 'http' , Test . adapter , { default : true } )
35
44
36
45
Test . p1 = { author : 'John' , age : 30 , id : 5 }
37
46
Test . p2 = { author : 'Sally' , age : 31 , id : 6 }
0 commit comments