2 * Copyright (c) Meta Platforms, Inc. and affiliates.
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
8 import {expect} from '@playwright/test';
9 import prettier from 'prettier';
11 // This tag function is just used to trigger prettier auto-formatting.
12 // (https://prettier.io/blog/2020/08/24/2.1.0.html#api)
14 partials: TemplateStringsArray,
18 for (let i = 0; i < partials.length; i++) {
19 output += partials[i];
20 if (i < partials.length - 1) {
27 export function expectHtmlToBeEqual(expected: string, actual: string): void {
28 expect(prettifyHtml(expected)).toBe(prettifyHtml(actual));
31 export function prettifyHtml(s: string): string {
32 return prettier.format(s.replace(/\n/g, ''), {parser: 'html'});