@joktec/arango
Version:
JokTec - ArangoDB Service
26 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Database = exports.MockCollection = exports.mockCollections = exports.mockDatabaseInstances = void 0;
const globals_1 = require("@jest/globals");
exports.mockDatabaseInstances = [];
exports.mockCollections = [];
class MockCollection {
constructor(name) {
this.import = globals_1.jest.fn(async (_docs, _options) => ({ created: 1, errors: 0 }));
this.name = name;
exports.mockCollections.push(this);
}
}
exports.MockCollection = MockCollection;
class Database {
constructor(config) {
this.collection = globals_1.jest.fn((name) => new MockCollection(name));
this.query = globals_1.jest.fn(async (_query, _options) => ({ all: globals_1.jest.fn(async () => []) }));
this.close = globals_1.jest.fn();
this.shutdown = globals_1.jest.fn(async () => undefined);
this.config = config;
exports.mockDatabaseInstances.push(this);
}
}
exports.Database = Database;
//# sourceMappingURL=arangojs.js.map