update module structure
This commit is contained in:
@ -101,8 +101,6 @@ tap.test('should be able to delete an instance of car', async () => {
|
||||
expect(myCar2.color).to.equal('red');
|
||||
});
|
||||
|
||||
|
||||
|
||||
// tslint:disable-next-line: max-classes-per-file
|
||||
@smartdata.Collection(() => {
|
||||
return testDb;
|
||||
@ -127,15 +125,13 @@ 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<Truck>({color: 'blue'});
|
||||
const myTruck = await Truck.getInstance<Truck>({ color: 'blue' });
|
||||
myTruck.id = 'foo';
|
||||
await myTruck.save();
|
||||
const myTruck2 = await Truck.getInstance<Truck>({color: 'blue'});
|
||||
const myTruck2 = await Truck.getInstance<Truck>({ color: 'blue' });
|
||||
console.log(myTruck2);
|
||||
|
||||
});
|
||||
|
||||
|
||||
// =======================================
|
||||
// close the database connection
|
||||
// =======================================
|
||||
|
Reference in New Issue
Block a user