'memory' is already defined
This commit is contained in:
parent
918497c365
commit
4ee7b5f440
|
@ -6,25 +6,25 @@ describe('Memory Connector', function(){
|
||||||
|
|
||||||
// or create it using the standard
|
// or create it using the standard
|
||||||
// data source creation api
|
// data source creation api
|
||||||
var memory = loopback.createDataSource({
|
memory = loopback.createDataSource({
|
||||||
connector: loopback.Memory
|
connector: loopback.Memory
|
||||||
});
|
});
|
||||||
|
|
||||||
// create a model using the
|
// create a model using the
|
||||||
// memory data source
|
// memory data source
|
||||||
var properties = {
|
var properties = {
|
||||||
name: String,
|
name: String,
|
||||||
price: Number
|
price: Number
|
||||||
};
|
};
|
||||||
|
|
||||||
var Product = memory.createModel('product', properties);
|
var Product = memory.createModel('product', properties);
|
||||||
|
|
||||||
Product.create([
|
Product.create([
|
||||||
{name: 'apple', price: 0.79},
|
{name: 'apple', price: 0.79},
|
||||||
{name: 'pear', price: 1.29},
|
{name: 'pear', price: 1.29},
|
||||||
{name: 'orange', price: 0.59},
|
{name: 'orange', price: 0.59},
|
||||||
], count);
|
], count);
|
||||||
|
|
||||||
function count() {
|
function count() {
|
||||||
Product.count(function (err, count) {
|
Product.count(function (err, count) {
|
||||||
assert.equal(count, 3);
|
assert.equal(count, 3);
|
||||||
|
@ -32,4 +32,4 @@ describe('Memory Connector', function(){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue