Skip to content

Commit 5484180

Browse files
author
Natallia Harshunova
committed
Formatting
1 parent e37a40a commit 5484180

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

src/McpResponse.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,10 @@ export class McpResponse implements Response {
253253
};
254254
} else if (message instanceof AggregatedIssue) {
255255
const mappedIssueMessage = mapIssueToMessageObject(message);
256-
if (!mappedIssueMessage) throw new Error('Can\'t prpovide detals for the msgid ' + consoleMessageStableId);
256+
if (!mappedIssueMessage)
257+
throw new Error(
258+
"Can't prpovide detals for the msgid " + consoleMessageStableId,
259+
);
257260
consoleData = {
258261
consoleMessageStableId,
259262
...mappedIssueMessage,

tests/McpResponse.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {describe, it} from 'node:test';
1212

1313
import sinon from 'sinon';
1414

15-
import { AggregatedIssue } from '../node_modules/chrome-devtools-frontend/mcp/mcp.js';
15+
import {AggregatedIssue} from '../node_modules/chrome-devtools-frontend/mcp/mcp.js';
1616

1717
import {
1818
getMockRequest,
@@ -300,13 +300,13 @@ describe('McpResponse', () => {
300300
});
301301
});
302302

303-
it('doesn\'t list the issue message if mapping returns null', async () => {
303+
it("doesn't list the issue message if mapping returns null", async () => {
304304
await withBrowser(async (response, context) => {
305305
const mockAggregatedIssue = sinon.createStubInstance(AggregatedIssue);
306-
const mockDescription = {
307-
file: 'not-existing-description-file.md',
308-
links: [],
309-
};
306+
const mockDescription = {
307+
file: 'not-existing-description-file.md',
308+
links: [],
309+
};
310310
mockAggregatedIssue.getDescription.returns(mockDescription);
311311
response.setIncludeConsoleData(true);
312312
context.getConsoleData = () => {
@@ -322,20 +322,20 @@ describe('McpResponse', () => {
322322
it('throws error if mapping returns null on get issue details', async () => {
323323
await withBrowser(async (response, context) => {
324324
const mockAggregatedIssue = sinon.createStubInstance(AggregatedIssue);
325-
const mockDescription = {
326-
file: 'not-existing-description-file.md',
327-
links: [],
328-
};
325+
const mockDescription = {
326+
file: 'not-existing-description-file.md',
327+
links: [],
328+
};
329329
mockAggregatedIssue.getDescription.returns(mockDescription);
330330
response.attachConsoleMessage(1);
331331
context.getConsoleMessageById = () => {
332332
return mockAggregatedIssue;
333333
};
334334

335335
try {
336-
await response.handle('test', context);
336+
await response.handle('test', context);
337337
} catch (e) {
338-
assert.ok(e.message.includes('Can\'t prpovide detals for the msgid 1'));
338+
assert.ok(e.message.includes("Can't prpovide detals for the msgid 1"));
339339
}
340340
});
341341
});

0 commit comments

Comments
 (0)