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

btrz-mongo-factory

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

btrz-mongo-factory - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

8

index.js

@@ -44,3 +44,3 @@ "use strict";

while(x < qty) {
let model = schemaFaker(schema, references);
let model = schemaFaker.generate(schema, references);
if (Array.isArray(overrides)) {

@@ -106,3 +106,4 @@ let index = x;

let overrides = options || {};
let model = modelGen(this.fixtures(modelName), 1, overrides, references).next().value;
const schema = this.fixtures(modelName) || references[0];
let model = modelGen(schema, 1, overrides, references).next().value;
return this.connection

@@ -121,3 +122,4 @@ .then((db) => {

let models = [];
for (let model of modelGen(this.fixtures(modelName), qty, overrides, references)) {
const schema = this.fixtures(modelName) || references[0];
for (let model of modelGen(schema, qty, overrides, references)) {
models.push(model);

@@ -124,0 +126,0 @@ }

{
"name": "btrz-mongo-factory",
"version": "4.0.0",
"version": "4.1.0",
"description": "\"A factory to create data in a mongoDb using chance and Json-Schema\"",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -113,2 +113,16 @@ /*jshint expr: true*/

it("should create an object with an schema and a $ref", function (done) {
factory.create("account_two", {}, [factory.fixtures("account"), factory.fixtures("tags")]).then(function (model) {
try {
expect(model.name).to.not.be.undefined;
expect(model.tags.length).to.not.be.eql(0);
expect(model.tags[0].id).to.not.be.undefined;
expect(model.tags[0].name).to.not.be.undefined;
done();
} catch(err) {
done(err);
}
});
});
it("should throw if references is not an array", function () {

@@ -115,0 +129,0 @@ function sut() {

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