fix(core): update
This commit is contained in:
15
test/test.ts
15
test/test.ts
@ -200,14 +200,19 @@ class Truck extends smartdata.SmartDataDbDoc<Car, Car> {
|
||||
tap.test('should store a new Truck', async () => {
|
||||
const truck = new Truck('blue', 'MAN');
|
||||
await truck.save();
|
||||
const myTruck = await Truck.getInstance({ color: 'blue' });
|
||||
myTruck.id = 'foo';
|
||||
await myTruck.save();
|
||||
const myTruck2 = await Truck.getInstance({ color: 'blue' });
|
||||
console.log(myTruck2);
|
||||
myTruck2.color = 'red';
|
||||
await myTruck2.save();
|
||||
const myTruck3 = await Truck.getInstance({ color: 'blue' });
|
||||
console.log(myTruck3);
|
||||
});
|
||||
|
||||
tap.test('should ', async () => {});
|
||||
tap.test('should use a cursor', async () => {
|
||||
const cursor = await Truck.getCursor({});
|
||||
cursor.forEach(async truckArg => {
|
||||
console.log(truckArg.id);
|
||||
});
|
||||
});
|
||||
|
||||
// =======================================
|
||||
// close the database connection
|
||||
|
Reference in New Issue
Block a user