ignore href in integration test to avoid fail when code changed
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
16
test/html/t.html
Normal file
16
test/html/t.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script id="_code">
|
||||||
|
const s = document.querySelector('#_code');
|
||||||
|
eval(`window.d = 123`);
|
||||||
|
document.body.removeChild(s);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -6,11 +6,7 @@ import * as rollup from 'rollup';
|
|||||||
import typescript = require('rollup-plugin-typescript');
|
import typescript = require('rollup-plugin-typescript');
|
||||||
import resolve = require('rollup-plugin-node-resolve');
|
import resolve = require('rollup-plugin-node-resolve');
|
||||||
import { SnapshotState, toMatchSnapshot } from 'jest-snapshot';
|
import { SnapshotState, toMatchSnapshot } from 'jest-snapshot';
|
||||||
import {
|
import { EventType, IncrementalSource, eventWithTime } from '../src/types';
|
||||||
incrementalSnapshotEvent,
|
|
||||||
EventType,
|
|
||||||
IncrementalSource,
|
|
||||||
} from '../src/types';
|
|
||||||
import { NodeType } from 'rrweb-snapshot';
|
import { NodeType } from 'rrweb-snapshot';
|
||||||
|
|
||||||
function matchSnapshot(actual: string, testFile: string, testTitle: string) {
|
function matchSnapshot(actual: string, testFile: string, testTitle: string) {
|
||||||
@@ -32,7 +28,7 @@ function matchSnapshot(actual: string, testFile: string, testTitle: string) {
|
|||||||
* So we only do snapshot test with filtered events.
|
* So we only do snapshot test with filtered events.
|
||||||
* @param snapshots incrementalSnapshotEvent[]
|
* @param snapshots incrementalSnapshotEvent[]
|
||||||
*/
|
*/
|
||||||
function stringifySnapshots(snapshots: incrementalSnapshotEvent[]): string {
|
function stringifySnapshots(snapshots: eventWithTime[]): string {
|
||||||
return JSON.stringify(
|
return JSON.stringify(
|
||||||
snapshots
|
snapshots
|
||||||
.filter(s => {
|
.filter(s => {
|
||||||
@@ -44,8 +40,11 @@ function stringifySnapshots(snapshots: incrementalSnapshotEvent[]): string {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
// FIXME: travis coordinates seems different with my laptop
|
|
||||||
.map(s => {
|
.map(s => {
|
||||||
|
if (s.type === EventType.Meta) {
|
||||||
|
s.data.href = 'about:blank';
|
||||||
|
}
|
||||||
|
// FIXME: travis coordinates seems different with my laptop
|
||||||
const coordinatesReg = /(bottom|top|left|right)/;
|
const coordinatesReg = /(bottom|top|left|right)/;
|
||||||
if (
|
if (
|
||||||
s.type === EventType.IncrementalSnapshot &&
|
s.type === EventType.IncrementalSnapshot &&
|
||||||
|
|||||||
Reference in New Issue
Block a user