
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
ava-webcomponents
Advanced tools
Utility middleware for testing web components in AVA via Puppeteer.
Utility middleware for testing web components in AVA via Puppeteer.
npm: npm install ava-webcomponents
yarn: yarn add ava-webcomponents
Create a file that renders content to the screen – such as a web component:
class Hello extends HTMLElement {
connectedCallback() {
this.innerHTML = 'Hello AVA!';
}
}
customElements.define('x-ava', Hello);
Use ava-webcomponents
to import the file in your AVA test, which then gives you access to the Puppeteer page
variable, as well as a util function for awaiting upgrade of a defined web component.
All imports in your web component file will be resolved relative to the nearest package.json
file, which uses a simple Express server instance to import your files.
import test from 'ava';
import withComponent from 'ava-webcomponents';
test(
'It should render "Hello AVA!";',
withComponent(`${__dirname}/helpers/example.js`),
async (t, { page, utils }) => {
await utils.waitForUpgrade('x-ava');
const content = await page.evaluate(() => {
const node = document.createElement('x-ava');
document.body.append(node);
return node.innerHTML;
});
t.is(content, 'Hello AVA!');
}
);
With the second argument of the withComponent
function you can pass options for puppeteer.launch
. However there's also a shortcut for debugging Puppeteer by using withComponent.debug
which slows down the tests, opens the devtools, and prevents Chromium from being headless.
FAQs
Utility middleware for testing web components in AVA via Puppeteer.
The npm package ava-webcomponents receives a total of 0 weekly downloads. As such, ava-webcomponents popularity was classified as not popular.
We found that ava-webcomponents 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.