
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
API Test Helpers for crude.
Install the module using NPM:
npm install crude-test --save
crude-test provides a convenient, fast and effective way to test your endpoints that were created using the crude package. Usage is pretty straighforward:
var CrudeTest = require('crude-test');
// load internal modules
var userFix = require('./fixtures/user.fix');
var UserEnt = require('./entities/user.ent');
// initialize the Crude tester
var crudeTest = new CrudeTest({
endpoint: '/user',
fixture: userFix.one,
stringAttr: 'firstName',
idAttr: '_id',
uniqueAttr: 'email',
Entity: UserEnt,
});
// run the tests
crudeTest.run();
Object= optOptions Optionally define a set of options.The crude-test package exposes a constructor that you need to invoke with the new keyword.
var CrudeTest = require('crude-test');
var crudeTest = new CrudeTest();
Object options A set of optionsYou may invoke setup() after the instanciation to configure the crude-test instance.
Find bellow all the available options to configure crude-test. In type definitions the = symbol means that the property is optional, all properties not having the equal symbol are REQUIRED:
* *hostname* `string` The hostname to perform the tests against, i.e. `http://localhost:3000`.
* *endpoint* `string` The endpoint to test, i.e. `/user`.
* *fixture* `Object` the data fixture to use, provide a data object to use for creating items.
* *stringAttr* `string` A string attribute in the fixture to use for updating and query filtering, any string type attribute will do.
* *uniqueAttr* `string` An attribute that acts as a unique identifier of the record, e.g. the email if the model is a user, in an empty db this can be any field, not neccessarily an actually unique one.
* *Entity* `Entity` The [entity instance](https://github.com/thanpolas/entity) of the model to be tested.
* *create* `Object` Create OP related parameters:
* *response* `Function` A node.js style callback with the tests res.
* *readList* `Object` Read List OP related parameters:
* *response* `Function` A node.js style callback with the tests res.
* *readItem* `Object` Read Item OP related parameters:
* *response* `Function` A node.js style callback with the tests res.
* *readFilter* `Object` Read Filter OP related parameters:
* *response* `Function` A node.js style callback with the tests res.
* *update* `Object` Update OP related parameters:
* *response* `Function` A node.js style callback with the tests res.
* *delete* `Object` Delete OP related parameters:
* *response* `Function` A node.js style callback with the tests res.
Copyright (c) 2014 Thanasis Polychronakis. Licensed under the MIT license.
FAQs
API Test Helpers for crude.
The npm package crude-test receives a total of 1 weekly downloads. As such, crude-test popularity was classified as not popular.
We found that crude-test 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.