update typescript and fix test cases

This commit is contained in:
Yanzhen Yu
2019-04-02 21:38:52 +08:00
parent 059cbe4fd8
commit faebeb08eb
4 changed files with 27 additions and 6 deletions

View File

@@ -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,