fix(core): update
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
@@ -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 () => {
|
||||
|
Reference in New Issue
Block a user