
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
laxar-mocks
Advanced tools
The companion testing framework for LaxarJS widgets.
Warning: This is the development version. You may want to browse the LaxarJS Mocks release documentation.
LaxarJS Mocks simplifies writing tests for LaxarJS widgets, and helps running them.
It is a library that allows you to instantiate a testing sandbox for widgets, and that helps you to mock the services and the lifecycle events that LaxarJS provides. Use LaxarJS Mocks on top of Jasmine to setup and load a widget just like in an actual application. The available APIs then support you in instrumenting and inspecting the widget under test.
Although most widgets only have little direct dependency on LaxarJS (often they use only its event bus) and should mostly follow the best practices for their rendering technology such as AngularJS, React or Vue.js, they rely on a specific setup process provided by the LaxarJS runtime and tools.
This setup process includes
LaxarJS Mocks provides a programmatic interface to control this process and to load a widget within a test.
It comes with the laxar-mocks/spec-loader for webpack, which makes sure that all controls and assets required for a widget test are collected, and that the appropriate adapter is loaded.
For an introduction to LaxarJS Mocks and details on test runner setup, have a look at the manuals. Additionally the API docs provide detailed information on the configuration, instrumentation and inspection options.
Usually, LaxarJS projects are started from the Yeoman Generator for LaxarJS 2.x, which automatically sets up LaxarJS Mocks for you, along with webpack and karma. If you need to perform a manual setup, for example as part of upgrading a LaxarJS 1.x project, there is an additional setup manual.
Instead of using a pre-compiled library within a project, you can also clone this repository:
git clone https://github.com/LaxarJS/laxar-mocks.git
cd laxar-mocks
npm install
To see changes in your application, either configure your project to work with the sources (e.g. by using webpack), or rebuild the webpack bundles by running npm run dist.
To run the automated karma tests:
npm test
To generate HTML spec runners for opening in your web browser, so that you can e.g. use the browser's developer tools:
npm run browser-spec
Now you can select a spec-runner by browsing to http://localhost:8087/spec-output/.
FAQs
Building large applications is hard, so don't do that!
The npm package laxar-mocks receives a total of 48 weekly downloads. As such, laxar-mocks popularity was classified as not popular.
We found that laxar-mocks 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
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.