
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
browser-monkey
Advanced tools
Reliable DOM testing
npm install browser-monkey
Browser Monkey is a DOM assertion library. It helps you write framework agnostic browser tests that are reliable in the face of asynchronous behaviours like animations, AJAX and delayed rendering. It also helps you to write tests that exhibit the semantic meaning of the page, as opposed to a jumble of CSS selectors.
Here is an example project that demonstrates how to use browser-monkey with Karma.
@dereke has made an excellent video of a TDD session using browser-monkey.
import createMonkey from "browser-monkey/create";
import createTestDiv from "browser-monkey/lib/createTestDiv";
import hyperdom from "hyperdom";
import App from "./app";
describe("beer app", () => {
let page;
beforeEach(() => {
const $testContainer = createTestDiv();
hyperdom.append($testContainer, new App());
page = createMonkey($testContainer);
});
it("greets me", async () => {
await page.find("h1").shouldHave({ text: "Hello Lubbers" });
});
it("shows me beer", async () => {
await page.click("Beer");
await page.shouldHave({ text: "Punk IPA" });
});
});
Join our remote team and help us build amazing software. Check out our career opportunities.
FAQs
reliable dom testing
The npm package browser-monkey receives a total of 185 weekly downloads. As such, browser-monkey popularity was classified as not popular.
We found that browser-monkey demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.