
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@jenkins-cd/js-test
Advanced tools
NPM module containing JavaScript utilities for testing Jenkins CI modules.
This package provides some test utilities.
Install Package:
npm install --save-dev @jenkins-cd/js-test
Also see js-modules and js-builder.
This utility allows you to test some content using jsdom (a lightweight "headless" browser).
Here's an example from the Twitter Bootstrap Framework lib.
var jsTest = require("@jenkins-cd/js-test");
var JENKINS_PAGE = '<html><head resURL="/jenkins"></head><body><div id="divOnPage">Bootstrap is everywhere</div></body></html>';
describe("bootstrap3.js", function () {
it("- test", function (done) {
jsTest.onPage(function() {
var bootstrap3 = require("../js/bootstrap3");
var $bootstrap = bootstrap3.getBootstrap();
expect($bootstrap('#divOnPage').text()).toBe('Bootstrap is everywhere');
done();
}, JENKINS_PAGE);
});
});
Note the call to
done();. This is a Jasmine "thing". It marks the end of an async test flow.
This utility makes it a bit easier to load the modules under test.
Without using requireSrcModule, tests would need to load source modules in an ugly/brittle path
(like in the above Bootstrap example) e.g.
var mathUtil = require('../../../src/js/utils/mathUtil');
Using requireSrcModule, the above code would be:
var jsTest = require("@jenkins-cd/js-test");
var mathUtil = jsTest.requireSrcModule('utils/mathUtil');
NOTE: This is integrated with js-builder. It will resolve the module being
required based on src/test builder configuration.
See the examples in js-samples, especially step-07-jsdom-tests and step-08-zombie-tests.
FAQs
NPM module containing JavaScript utilities for testing Jenkins CI modules.
We found that @jenkins-cd/js-test demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.