A powerful test framework.
Documentation | Getting Started
npm install xbell
To install the browser module, run the following command:
npx xbell install browser
Here's an example of how to use XBell to test your code in Node.js:
import { test } from 'xbell';
test('test code in nodejs', ({ expect }) => {
const { add } = await import('./add');
const result = add(1, 1);
expect(result).toBe(2);
});
Here's an example of how to use XBell to test your code in the browser:
test.browser('test code in browser', ({ expect, page }) => {
const { add } = await import('./add');
const result = add(1, 1);
expect(result).toBe(2);
window.document.body.innerHTML = result;
await expect(page).toMatchScreenshot({
name: 'default-screenshot',
});
});
Here's an example of how to use XBell to perform end-to-end testing:
test('e2e testing', ({ page, expect }) => {
await page.goto('https://example.com');
await expect(page).toMatchScreenshot({
name: 'default-screenshot',
});
});
XBell is MIT licensed.