update typescript and fix test cases

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 32c33f3ce8
commit ebaa318d54
4 changed files with 27 additions and 6 deletions

View File

@@ -2,9 +2,15 @@ import * as fs from 'fs';
import * as path from 'path';
import * as puppeteer from 'puppeteer';
import { assertSnapshot } from './utils';
import { Suite } from 'mocha';
describe('record integration tests', () => {
function getHtml(fileName: string): string {
interface ISuite extends Suite {
code: string;
browser: puppeteer.Browser;
}
describe('record integration tests', function(this: ISuite) {
const getHtml = (fileName: string): string => {
const filePath = path.resolve(__dirname, `./html/${fileName}`);
const html = fs.readFileSync(filePath, 'utf8');
return html.replace(
@@ -24,7 +30,7 @@ describe('record integration tests', () => {
</body>
`,
);
}
};
before(async () => {
this.browser = await puppeteer.launch({