Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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
The npm package dustjs-test-helper receives a total of 0 weekly downloads. As such, dustjs-test-helper popularity was classified as not popular.
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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.