All files index.js

90.91% Statements 10/11
75% Branches 3/4
100% Functions 1/1
90.91% Lines 10/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25  1x 1x 1x     4x 4x 4x 4x     4x 4x     4x                
// eslint-disable-next-line import/no-namespace
import * as driver from 'bigchaindb-driver'
import Connection from './connection'
import OrmObject from './ormobject'
 
export default class Orm {
    constructor(connectionUrl, headers) {
        this.connection = new Connection(connectionUrl, headers)
        this.appId = ''
        Iif (headers && headers.app_id) {
            this.appId = headers.app_id
        }
        this.models = []
        this.driver = driver
    }
    define(modelName, modelSchema) {
        this.models[modelName] = new OrmObject(
            modelName,
            modelSchema,
            this.connection,
            this.appId
        )
    }
}