rethinkdb-fixtures
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -23,3 +23,10 @@ 'use strict'; | ||
resolve(result[0]); | ||
const pack = {}; | ||
result.forEach( (object) => { | ||
const key = Object.keys(object)[0]; | ||
pack[key] = object[key]; | ||
}); | ||
resolve(pack); | ||
prep.close(); | ||
@@ -26,0 +33,0 @@ },reject); |
{ | ||
"name": "rethinkdb-fixtures", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Easily load fixtures into Rethinkdb. Useful for testing.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
'use strict'; | ||
const Insert = require('../index').Insert; | ||
const _ = require('lodash'); | ||
const Lab = require('lab'); | ||
@@ -23,2 +22,7 @@ const Code = require('code'); | ||
} | ||
], | ||
artists: [ | ||
{ | ||
name: 'Crazy Ass Wicked Wild' | ||
} | ||
] | ||
@@ -31,9 +35,10 @@ }; | ||
Insert(options, fixture).then( (result) => { | ||
Insert(options, fixture).then( (objects) => { | ||
const names = result.items.map( (item) => { | ||
const idx = objects.items.findIndex( (item) => { | ||
return item.name; | ||
return item.name === 'Item 1'; | ||
}); | ||
expect(_.includes(names, 'Item 1')).to.be.equal(true); | ||
expect(objects.items[idx].name).to.be.equal(fixture.items[0].name); | ||
expect(objects.artists[0].name).to.be.equal(fixture.artists[0].name); | ||
done(); | ||
@@ -40,0 +45,0 @@ }, console.error); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16272
511