push
github
1353 of 1531 branches covered (88.37%)
Branch coverage included in aggregate %.
83 of 1501 new or added lines in 19 files covered. (5.53%)
22 existing lines in 1 file now uncovered.5401 of 10859 relevant lines covered (49.74%)
27.77 hits per line
NEW
|
// eslint-disable no-case-declarations
|
× |
NEW
|
import type { PageSpyPlugin } from '@huolala-tech/page-spy-types'; |
× |
NEW
|
import XhrProxy from './proxy/xhr-proxy'; |
× |
NEW
|
import FetchProxy from './proxy/fetch-proxy'; |
× |
NEW
|
|
× |
NEW
|
export default class NetworkPlugin implements PageSpyPlugin { |
× |
NEW
|
public name = 'NetworkPlugin'; |
× |
NEW
|
|
× |
NEW
|
public xhrProxy: XhrProxy | null = null;
|
× |
NEW
|
public fetchProxy: FetchProxy | null = null;
|
× |
NEW
|
|
× |
NEW
|
public static hasInitd = false; |
× |
NEW
|
|
× |
NEW
|
public onInit() {
|
× |
NEW
|
if (NetworkPlugin.hasInitd) return; |
× |
NEW
|
NetworkPlugin.hasInitd = true;
|
× |
NEW
|
|
× |
NEW
|
this.fetchProxy = new FetchProxy(); |
× |
NEW
|
this.xhrProxy = new XhrProxy(); |
× |
NEW
|
} |
× |
NEW
|
|
× |
NEW
|
public onReset() {
|
× |
NEW
|
this.fetchProxy?.reset();
|
× |
NEW
|
this.xhrProxy?.reset();
|
× |
NEW
|
NetworkPlugin.hasInitd = false;
|
× |
NEW
|
} |
× |
NEW
|
} |
× |