Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Conversation

bajtos
Copy link
Contributor

@bajtos bajtos commented Dec 11, 2013

Usage:

// The context object to hold the created models.   
// You can use `this` in mocha test instead.        
var context = {};                                   

var ref = TestDataBuilder.ref;                      
new TestDataBuilder()                               
  .define('application', Application, {             
    pushSettings: { stub: { } }                     
  })                                                
  .define('device', Device, {                       
     appId: ref('application.id'),                  
     deviceType: 'android'                          
  })                                                
  .define('notification', Notification)             
  .buildTo(context, function(err) {                 
    // test models are available as                 
    //   context.application                        
    //   context.device                             
    //   context.notification                       
  });                                               

/to: @raymondfeng @ritch Please review.
/cc: @rmg @Schoonology

Related discussions in loopback-push-notification: what values to use as default, what types to support.

@slnode
Copy link

slnode commented Dec 11, 2013

Test PASSed. To trigger a build add comment - ".test\W+please"
Refer to this link for build results: http://ci.strongloop.com/job/loopback-testing/10/

@slnode
Copy link

slnode commented Dec 11, 2013

Test PASSed. To trigger a build add comment - ".test\W+please"
Refer to this link for build results: http://ci.strongloop.com/job/loopback-testing/11/

@ritch
Copy link
Contributor

ritch commented Dec 11, 2013

What is ref used for?

Edit - I see now.

@ritch
Copy link
Contributor

ritch commented Dec 11, 2013

Can ref be available as this.ref() in define callbacks?

@ritch
Copy link
Contributor

ritch commented Dec 11, 2013

Overall LGTM

@bajtos
Copy link
Contributor Author

bajtos commented Dec 11, 2013

Can ref be available as this.ref() in define callbacks?

No, as there are not define callbacks. define accepts objects only.

bajtos added a commit that referenced this pull request Dec 11, 2013
@bajtos bajtos merged commit 88cdb97 into master Dec 11, 2013
@bajtos bajtos deleted the feature/test-data-builder branch December 11, 2013 19:46
@bajtos bajtos mentioned this pull request Dec 19, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants