deno.land / x / mongoose@6.7.5 / test / helpers / update.applyTimestampsToUpdate.test.js

update.applyTimestampsToUpdate.test.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict';
const applyTimestampsToUpdate = require('../../lib/helpers/update/applyTimestampsToUpdate');const assert = require('assert');
describe('applyTimestampsToUpdate', function() { it('handles update pipelines (gh-11151)', function() { const update = [{ $set: { title: 'mongoose-with-aggregate-set' } }]; const now = new Date('2016-01-01'); const res = applyTimestampsToUpdate(now, 'created_at', 'updated_at', update, {});
assert.equal(res.length, 2); assert.equal(res[1].$set.updated_at.valueOf(), now.valueOf()); });});
mongoose

Version Info

Tagged at
a year ago