
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
dustjs-test-helper
Advanced tools
Test helpers to help test custom extensions (custom helpers, filter, etc.) of dustjs-linkedin.
before and after hooks so you can modify or spy on the chunk, context, params, etc internals$ npm install --save-dev dustjs-test-helper
Note: the test helper has a peer-dependency on dustjs-linkedin, which means you should have it installed in your repo as a dependency/dev dependency
you will likely want to use the test method. There is one specific for testing Dust's @helpers and a different one for Dust filters.
@see tests/example for an example using sinon, mocha and chai.
var dustTester = require('dustjs-test-helper');
dustTesters.helpers.test(setupObject, function(err, out) {
// same as a dust.render callback
});
test a custom helper using the fake template {@setupObjectName/}. use before hooks to modify this further.
var dustTester = require('dustjs-test-helper');
dustTesters.filters.test(setupObject, function(err, out) {
// same as a dust.render callback
});
test a custom filter using the fake template {key|setupObjectName}. use before hooks to modify this further.
Type: object
Type:string
name of the @helper or |filter. Dust looks for this name in the dust.helpers and dust.filters objects and also matches what is used in the template
Type:function
the implementation of the helper or filter. The helper function signature is (chunk, context, bodies, params) while the filter function signature is (data)
Type:function
Default: function(){}
hook to be called before fn. gets the same params. useful for spying, setup, modifying, etc.
Type:function
Default: function(){}
hook to be called after fn. gets the same params. useful for asserting, doing cleanup, etc.
Type:object
Default: {}
context used to render the fake template
MIT [jimmyhchan]
FAQs
helper methods for testing dust
We found that dustjs-test-helper 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.