We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2657417 commit ad5f8a1Copy full SHA for ad5f8a1
test/query.test.js
@@ -2328,18 +2328,20 @@ describe('Query', function() {
2328
});
2329
2330
2331
- it('map (gh-7142)', async function() {
+ it('transform (gh-14236) (gh-7142)', async function() {
2332
const Model = db.model('Test', new Schema({ name: String }));
2333
2334
-
+ let called = 0;
2335
await Model.create({ name: 'test' });
2336
const now = new Date();
2337
const res = await Model.findOne().transform(res => {
2338
res.loadedAt = now;
2339
+ ++called;
2340
return res;
2341
2342
2343
assert.equal(res.loadedAt, now);
2344
+ assert.strictEqual(called, 1);
2345
2346
2347
describe('orFail (gh-6841)', function() {
0 commit comments