viewmodel
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -6,3 +6,3 @@ // lib/databases/inMemory.js v0.1.0 | ||
, store = {} | ||
, idCounter = 0; | ||
, uuid = require('../uuid'); | ||
@@ -62,3 +62,3 @@ function deepFind(obj, pattern) { | ||
if (callback) callback(null, (idCounter++).toString()); | ||
if (callback) callback(null, uuid().toString()); | ||
}, | ||
@@ -77,3 +77,3 @@ | ||
callback = id; | ||
id = (idCounter++).toString(); | ||
id = uuid().toString(); | ||
} | ||
@@ -80,0 +80,0 @@ |
{ | ||
"author": "adrai", | ||
"name": "viewmodel", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -524,2 +524,4 @@ var expect = require('expect.js') | ||
var obj, retObj; | ||
it('it should insert a new record', function(done) { | ||
@@ -529,3 +531,5 @@ | ||
vm.foo = 'baz'; | ||
dummyRepo.commit(vm, function(err) { | ||
obj = vm; | ||
dummyRepo.commit(vm, function(err, ret) { | ||
retObj = ret; | ||
dummyRepo.get('4569', function(err, vm2) { | ||
@@ -542,2 +546,13 @@ vm.actionOnCommit = 'update'; | ||
describe('and', function() { | ||
it('it should return the vm with updated actionOnCommit', function() { | ||
expect(obj.id).to.eql(retObj.id); | ||
expect(retObj.actionOnCommit).to.eql('update'); | ||
}); | ||
}); | ||
}); | ||
@@ -571,2 +586,4 @@ | ||
var obj, retObj; | ||
it('it should update the existing record', function(done) { | ||
@@ -576,3 +593,5 @@ | ||
vm.foo = 'baz'; | ||
dummyRepo.commit(vm, function(err) { | ||
obj = vm; | ||
dummyRepo.commit(vm, function(err, ret) { | ||
retObj = ret; | ||
dummyRepo.get('4567', function(err, vm2) { | ||
@@ -588,2 +607,13 @@ expect(vm2.id).to.eql(vm.id); | ||
describe('and', function() { | ||
it('it should return the vm with updated actionOnCommit', function() { | ||
expect(obj.id).to.eql(retObj.id); | ||
expect(retObj.actionOnCommit).to.eql('update'); | ||
}); | ||
}); | ||
}); | ||
@@ -590,0 +620,0 @@ |
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
69919
1523