Initial import

This commit is contained in:
2025-11-05 20:35:04 +01:00
commit 5b1fd847c2
4586 changed files with 685044 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
const Datastore = require('../src/Datastore');
describe('testing document counting', () => {
const docs = [
{ name: '1st document' },
{ name: '2nd document' },
{ name: '3rd document' },
];
const datastore = Datastore.create();
beforeEach(() => datastore.insert(docs));
afterEach(() => datastore.remove({}, { multi: true }));
describe('count', () => {
it('should get the count of the docs', async () => {
const count = await datastore.count();
expect(count).toBe(3);
});
it('should get the count of the docs when limiting', async () => {
const count = await datastore.count().limit(2);
expect(count).toBe(2);
});
});
});