update module structure

This commit is contained in:
2020-06-11 23:05:32 +00:00
parent 3f714b1a33
commit 116dfbc3b0
13 changed files with 3944 additions and 1386 deletions

View File

@ -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
// =======================================