Addnew sheets (armor, weapons, malefica) and v13 support

This commit is contained in:
2025-05-18 23:51:26 +02:00
parent 7672f861ff
commit 995d61e1c6
4478 changed files with 667857 additions and 620 deletions

43
node_modules/nedb-promises/test/c.find.test.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
const Datastore = require('../src/Datastore');
describe('testing document finding', () => {
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('single', () => {
it('should find the first inserted doc', async () => {
const foundDoc = await datastore.findOne();
expect(foundDoc).toHaveProperty('_id');
expect(foundDoc).toHaveProperty('name');
expect(foundDoc.name).toMatch(/^(1st|2nd|3rd) document$/);
});
it('should find the last inserted doc when sorting backwards', async () => {
const foundDoc = await datastore.findOne().sort({ name: -1 });
expect(foundDoc).toHaveProperty('_id');
expect(foundDoc).toHaveProperty('name');
expect(foundDoc.name).toBe('3rd document');
});
});
describe('bulk', () => {
it('should find all inserted docs', async () => {
const foundDocs = await datastore.find().sort({ name: 1 }).exec();
expect(foundDocs).toMatchObject(docs);
});
});
describe('find().then()', () => {
it('should find all inserted docs', async () => {
const foundDocs = await datastore.find().sort({ name: 1 });
expect(foundDocs).toMatchObject(docs);
});
});
});