Files
handlebars.js/tests/browser/spec.js
Jakob Linskeseder b2a083136b Fix browser tests
Pinned the browser tests to the latest Playwright version that still works with Node 16.
We need Node 16 for a successful build.
2026-03-25 22:08:13 +01:00

34 lines
1.1 KiB
JavaScript

const { test, expect } = require('@playwright/test');
async function waitForMochaAndAssertResult(page) {
await page.waitForFunction(() => window.mochaResults); // eslint-disable-line no-undef
const mochaResults = await page.evaluate('window.mochaResults');
expect(mochaResults.failures).toBe(0);
}
test('Spec handlebars.js', async ({ page }) => {
await page.goto(`/spec/?headless=true`);
await waitForMochaAndAssertResult(page);
});
test('Spec handlebars.amd.js (AMD)', async ({ page }) => {
await page.goto(`/spec/amd.html?headless=true`);
await waitForMochaAndAssertResult(page);
});
test('Spec handlebars.runtime.amd.js (AMD)', async ({ page }) => {
await page.goto(`/spec/amd-runtime.html?headless=true`);
await waitForMochaAndAssertResult(page);
});
test('Spec handlebars.js (UMD)', async ({ page }) => {
await page.goto(`/spec/umd.html?headless=true`);
await waitForMochaAndAssertResult(page);
});
test('Spec handlebars.runtime.js (UMD)', async ({ page }) => {
await page.goto(`/spec/umd-runtime.html?headless=true`);
await waitForMochaAndAssertResult(page);
});