Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

factory-girl

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

factory-girl - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

2

package.json

@@ -6,3 +6,3 @@ {

"author": "Simon Wade",
"version": "0.1.4",
"version": "0.1.5",
"keywords": ["factory", "test", "bdd", "tdd", "fixture"],

@@ -9,0 +9,0 @@ "repository" : {

# factory-girl
[![Build Status](https://travis-ci.org/aexmachina/factory-girl.png)](https://travis-ci.org/aexmachina/factory-girl)
`factory-girl` is a factory library for [Node.js](http://nodejs.org/) and the browser that is inspired by [Factory\_girl](http://github.com/thoughtbot/factory_girl). It works asynchronously and supports associations and the use of functions for generating attributes.

@@ -19,4 +21,2 @@

JavaScript:
```javascript

@@ -30,3 +30,3 @@ var factory = require('factory-lady'),

factory.define('user', User, {
state: 'activated',
state: 'active',
// define attributes using functions

@@ -42,2 +42,3 @@ email: function() {

});
console.log(factory.build('user')); => {state: 'active', email: 'user1@example.com', async: 'foo', password: '123456'}

@@ -49,3 +50,2 @@ factory.define('post', Post, {

subject: 'Hello World',
content: 'Lorem ipsum dolor sit amet...',
// you can refer to other attributes using `this`

@@ -57,2 +57,3 @@ slug: function() {

```
console.log(factory.build('post')); => {user_id: 123, subject: 'Hello World', slug: 'hello-world'}

@@ -59,0 +60,0 @@ ## Using Factories

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc