update typescript and fix test cases
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
"ts-node": "^7.0.1",
|
||||
"tslib": "^1.9.3",
|
||||
"tslint": "^4.5.1",
|
||||
"typescript": "^3.2.4"
|
||||
"typescript": "^3.4.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/smoothscroll-polyfill": "^0.3.0",
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -11,6 +11,14 @@ import {
|
||||
EventType,
|
||||
} from '../src/types';
|
||||
import { assertSnapshot } from './utils';
|
||||
import { Suite } from 'mocha';
|
||||
|
||||
interface ISuite extends Suite {
|
||||
code: string;
|
||||
browser: puppeteer.Browser;
|
||||
page: puppeteer.Page;
|
||||
events: eventWithTime[];
|
||||
}
|
||||
|
||||
interface IWindow extends Window {
|
||||
rrweb: {
|
||||
@@ -19,7 +27,7 @@ interface IWindow extends Window {
|
||||
emit: (e: eventWithTime) => undefined;
|
||||
}
|
||||
|
||||
describe('record', () => {
|
||||
describe('record', function(this: ISuite) {
|
||||
before(async () => {
|
||||
this.browser = await puppeteer.launch({
|
||||
headless: false,
|
||||
|
||||
@@ -4,6 +4,7 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as puppeteer from 'puppeteer';
|
||||
import { expect } from 'chai';
|
||||
import { Suite } from 'mocha';
|
||||
import {
|
||||
EventType,
|
||||
eventWithTime,
|
||||
@@ -113,7 +114,13 @@ interface IWindow extends Window {
|
||||
};
|
||||
}
|
||||
|
||||
describe('replayer', () => {
|
||||
interface ISuite extends Suite {
|
||||
code: string;
|
||||
browser: puppeteer.Browser;
|
||||
page: puppeteer.Page;
|
||||
}
|
||||
|
||||
describe('replayer', function(this: ISuite) {
|
||||
before(async () => {
|
||||
this.browser = await puppeteer.launch({
|
||||
headless: false,
|
||||
|
||||
Reference in New Issue
Block a user