update typescript and fix test cases
This commit is contained in:
@@ -53,7 +53,7 @@
|
|||||||
"ts-node": "^7.0.1",
|
"ts-node": "^7.0.1",
|
||||||
"tslib": "^1.9.3",
|
"tslib": "^1.9.3",
|
||||||
"tslint": "^4.5.1",
|
"tslint": "^4.5.1",
|
||||||
"typescript": "^3.2.4"
|
"typescript": "^3.4.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/smoothscroll-polyfill": "^0.3.0",
|
"@types/smoothscroll-polyfill": "^0.3.0",
|
||||||
|
|||||||
@@ -2,9 +2,15 @@ import * as fs from 'fs';
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as puppeteer from 'puppeteer';
|
import * as puppeteer from 'puppeteer';
|
||||||
import { assertSnapshot } from './utils';
|
import { assertSnapshot } from './utils';
|
||||||
|
import { Suite } from 'mocha';
|
||||||
|
|
||||||
describe('record integration tests', () => {
|
interface ISuite extends Suite {
|
||||||
function getHtml(fileName: string): string {
|
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 filePath = path.resolve(__dirname, `./html/${fileName}`);
|
||||||
const html = fs.readFileSync(filePath, 'utf8');
|
const html = fs.readFileSync(filePath, 'utf8');
|
||||||
return html.replace(
|
return html.replace(
|
||||||
@@ -24,7 +30,7 @@ describe('record integration tests', () => {
|
|||||||
</body>
|
</body>
|
||||||
`,
|
`,
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
this.browser = await puppeteer.launch({
|
this.browser = await puppeteer.launch({
|
||||||
|
|||||||
@@ -11,6 +11,14 @@ import {
|
|||||||
EventType,
|
EventType,
|
||||||
} from '../src/types';
|
} from '../src/types';
|
||||||
import { assertSnapshot } from './utils';
|
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 {
|
interface IWindow extends Window {
|
||||||
rrweb: {
|
rrweb: {
|
||||||
@@ -19,7 +27,7 @@ interface IWindow extends Window {
|
|||||||
emit: (e: eventWithTime) => undefined;
|
emit: (e: eventWithTime) => undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('record', () => {
|
describe('record', function(this: ISuite) {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
this.browser = await puppeteer.launch({
|
this.browser = await puppeteer.launch({
|
||||||
headless: false,
|
headless: false,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import * as fs from 'fs';
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as puppeteer from 'puppeteer';
|
import * as puppeteer from 'puppeteer';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
|
import { Suite } from 'mocha';
|
||||||
import {
|
import {
|
||||||
EventType,
|
EventType,
|
||||||
eventWithTime,
|
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 () => {
|
before(async () => {
|
||||||
this.browser = await puppeteer.launch({
|
this.browser = await puppeteer.launch({
|
||||||
headless: false,
|
headless: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user