meteor / todos

The example app "Todos", written following the Meteor Guide
Other
535 stars 367 forks source link

Explain Factory.build() Method #234

Closed ghost closed 7 years ago

ghost commented 7 years ago

I could not understand Factory.build() method

const todo = Factory.build('todo', { checked: false });

In this code what is todo inside Factory.build('todo', { checked: false })

Is it userdefine or predefine? Please explain

hwillson commented 7 years ago

Hi @salimakhtar786 - issues here are reserved for todos bugs / feature requests. For help with understanding how todos works, your questions are better asked on the Meteor forum.

In this case, Factory.build is an API call from the dburles:factory package. You can find out more in that packages API docs, but in a nutshell it's building a fake todo object that can be used within the test.