
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@ficusjs/testing
Advanced tools
The FicusJS testing package provides lightweight helper functions for web component testing.
This package provides browser globals such as window and document using jsdom which is an implementation of many browser APIs ideal for testing but is not an actual browser.
We recommend using a tool such as Cypress for browser end-to-end tests.
This package contains functions intended for a NodeJS environment and not a real browser. It is therefore, best used for fast iteration.
The functions can be used with any NodeJS testing framework.
The following functions are available in the FicusJS testing package.
init - a function for initializing the test environmentrender - a function to render a web component for testingThe init function initializes the NodeJS environment ready for testing.
Simply call init in your set-up hook.
import test from 'ava'
import { init, render } from '@ficusjs/testing'
test.before(init)
The render function will create a new web component instance for testing.
It returns a DOM instance of the component.
import test from 'ava'
import { init, render } from '@ficusjs/testing'
test.before(init)
test('render basic component', async t => {
const comp = await render('basic-comp', () => import('../src/component.mjs'))
t.is(comp.querySelector('p').textContent, 'Basic component')
})
The render function accepts the following arguments:
| Name | Type | Description |
|---|---|---|
tagName | string | The web component tag name |
importer | function | A function that registers a web component. This can return a Promise |
Testing web components can be done in a number of ways.
It is a good idea to start with creating basic smoke tests for your components.
Testing that a component mounts and ensures that it doesn't throw during rendering provides a lot of value with very little effort.
FAQs
Helper functions for component testing
The npm package @ficusjs/testing receives a total of 29 weekly downloads. As such, @ficusjs/testing popularity was classified as not popular.
We found that @ficusjs/testing demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.