
Security News
Node.js Moves Toward Stable TypeScript Support with Amaro 1.0
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
test-mongoose-utils
Advanced tools
$ npm install test-mongoose-utils
const TestMongooseUtils = require('test-mongoose-utils');
const tmu = new TestMongooseUtils();
const Todo = require('./Todo');
describe('module', () => {
before(done => {
tmu.registerModels([Todo]); // Enables some functionality.
// connect to mongoose...
});
after(done => {
tmu.restore(); // Restores spies.
// disconnect to mongoose...
});
afterEach(() => {
tmu.reset(); // Resets spies' records.
});
test('Todo uuid is unique', done => {
const data = { uuid: 'bananaMan' };
const createTodo = mainCb =>
tmu.assertChanges({ // Will assert @expectedChanges after @act.
act: cb =>
Todo.create(data, cb),
expectedChanges: {
db: {
// Tells tmu to assert that Todo.count({}) incr's by 1 after @act.
counts: [[Todo, {}, 1]]
}
}
}, mainCb);
const createTodoDupe = mainCb =>
tmu.assertChanges({ // Will assert @expectedChanges after @act.
act: cb =>
Todo.create(data, cb),
expectedChanges: {
db: {
// Tells tmu to assert that Model.<mutate>
// or Model.prototype.<mutate> methods were not called.
wasMutated: [[Todo, false]]
}
}
}, mainCb);
async.series([
createTodo,
createTodoDupe
], done);
});
});
FAQs
Test utils using mongoose.
The npm package test-mongoose-utils receives a total of 0 weekly downloads. As such, test-mongoose-utils popularity was classified as not popular.
We found that test-mongoose-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.