Silo Modules for Compass Test Automation, One of Libraries in CTA-OSS Framework
The cta-silo provides a local storage to store data (documents). Currently, the cta-silo uses NeDB, the file-based JavaScript Database.
We aim to give you brief guidelines here.
cta-silo extends Brick (cta-brick). In order to use it, we need to provide a configuration. The cta-silo has no dependencies.
const config = {
name: 'silo-01',
module: 'cta-silo',
properties: {
filename: `${__dirname}${path.sep}silo.db`,
},
};
The data will be stored in silo.db file.
The configuration requires properties.filename.
const config = {
...
properties: {
filename: `absolute/path/to/a/storage/file`,
},
};
The properties.filename must be a filename with absolute path. The properties provide a configuration to NeDB.
| nature.type | nature.quality | payload | --- | --- | --- | --- | documents | backup | { doc: { id: '01' } } or { doc: [ { id: '01' }, { id: '02' } ] } | documents | restore | { query: {}, clear: true } | documents | clear | { query: {} }