11/* global JSData:true, JSDataHttp:true, sinon:true, chai:true */
2+
23before ( function ( ) {
34 var Test = this
5+ Test . TEST_FETCH = false
46 Test . fail = function ( msg ) {
57 if ( msg instanceof Error ) {
68 console . log ( msg . stack )
@@ -14,7 +16,15 @@ before(function () {
1416 }
1517 Test . sinon = sinon
1618 Test . JSData = JSData
19+ Test . addAction = JSDataHttp . addAction
20+ Test . addActions = JSDataHttp . addActions
1721 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+
1828 Test . User = new JSData . Mapper ( {
1929 name : 'user'
2030 } )
@@ -24,14 +34,13 @@ before(function () {
2434 basePath : 'api'
2535 } )
2636
37+ Test . User . registerAdapter ( 'http' , Test . adapter , { default : true } )
38+ Test . Post . registerAdapter ( 'http' , Test . adapter , { default : true } )
2739 console . log ( 'Testing against js-data ' + JSData . version . full )
2840} )
2941
3042beforeEach ( function ( ) {
3143 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 } )
3544
3645 Test . p1 = { author : 'John' , age : 30 , id : 5 }
3746 Test . p2 = { author : 'Sally' , age : 31 , id : 6 }
0 commit comments