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.1.0 to 4.2.0

8

index.js

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

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

@@ -59,2 +64,3 @@ let index = x;

} catch(e) {
console.log(e);
throw new Error("There was a problem with the references array, make sure it contains a valid json-schemas: " + e);

@@ -61,0 +67,0 @@ }

2

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

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

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

});
it("should throw if references contains undefined", function () {
function sut() {
factory.create("account", {}, [undefined]);
}
expect(sut).to.throw("There was a problem with the references array, make sure it contains a valid json-schemas: TypeError: Cannot read property '$id' of undefined");
});
it("should throw is references contains null", function () {
function sut() {
factory.create("account", {}, [null]);
}
expect(sut).to.throw("There was a problem with the references array, make sure it contains a valid json-schemas: TypeError: Cannot read property '$id' of null");
});
});

@@ -149,0 +135,0 @@

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