fix(core): update

This commit is contained in:
2022-06-06 13:04:30 +02:00
parent 82d970069b
commit 32d3ea4d65
10 changed files with 56 additions and 11 deletions

View File

@@ -24,9 +24,24 @@ export const generateTestData = async (mongoDescriptorArg: smartdata.IMongoDescr
}
}
@smartdata.Collection(db)
class Truck extends smartdata.SmartDataDbDoc<Truck, Truck> {
@smartdata.unI()
id = `hello-${counter}`;
@smartdata.svDb()
data = {
'some' : {
'complex': 'structure'
}
}
}
while (counter < 100) {
const house = new House();
await house.save();
const truck = new Truck();
await truck.save();
counter++;
}
}

View File

@@ -23,6 +23,14 @@ tap.test('should deploy sample data', async () => {
tap.test('should add a mongotarget to mongodump instance', async () => {
const target = await testMongodump.addMongoTargetByMongoDescriptor(await testSmartMongo.getMongoDescriptor());
await target.getCollections();
});
tap.test('should dump a collection to a directory', async () => {
const target = await testMongodump.addMongoTargetByMongoDescriptor(await testSmartMongo.getMongoDescriptor());
const collections = await target.getCollections();
for (const collection of collections) {
await target.dumpCollectionToDir(collection, '.nogit', doc => doc.id);
}
})
tap.test('should stop the smartmongo instance', async () => {