Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show jest tests which ran in the recording as console messages #5496

Merged
merged 2 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/devtools/client/webconsole/actions/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const {
const { IdGenerator } = require("devtools/client/webconsole/utils/id-generator");
const { ThreadFront } = require("protocol/thread");
const { LogpointHandlers } = require("protocol/logpoint");
const { TestMessageHandlers } = require("protocol/find-tests");

const {
MESSAGES_ADD,
Expand All @@ -36,6 +37,7 @@ export function setupMessages(store) {
LogpointHandlers.onResult = (logGroupId, point, time, location, pause, values) =>
store.dispatch(onLogpointResult(logGroupId, point, time, location, pause, values));
LogpointHandlers.clearLogpoint = logGroupId => store.dispatch(messagesClearLogpoint(logGroupId));
TestMessageHandlers.onTestMessage = msg => store.dispatch(onConsoleMessage(msg));

ThreadFront.findConsoleMessages(
(_, msg) => store.dispatch(onConsoleMessage(msg)),
Expand Down
10 changes: 10 additions & 0 deletions src/protocol/analysisManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
AnalysisId,
analysisPoints,
analysisResult,
ExecutionPoint,
PointDescription,
SessionId,
} from "@recordreplay/protocol";
Expand All @@ -22,6 +23,7 @@ export interface AnalysisParams {
eventHandlerEntryPoints?: EventHandlerEntryPoint[];
exceptionPoints?: boolean;
randomPoints?: number;
points?: ExecutionPoint[];
sessionId: SessionId;
}

Expand Down Expand Up @@ -98,6 +100,14 @@ class AnalysisManager {
);
}

if (params.points) {
await sendMessage(
"Analysis.addPoints",
{ analysisId, points: params.points },
params.sessionId
);
}

this.handlers.set(analysisId, handler);
await Promise.all([
!handler.onAnalysisResult ||
Expand Down
4 changes: 4 additions & 0 deletions src/protocol/execution-point-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ export function pointEquals(p1: ExecutionPoint, p2: ExecutionPoint) {
export function pointPrecedes(p1: ExecutionPoint, p2: ExecutionPoint) {
return compareNumericStrings(p1, p2) < 0;
}

export function comparePoints(p1: ExecutionPoint, p2: ExecutionPoint) {
return compareNumericStrings(p1, p2);
}
Loading