Fix #29- A network error in the console should show the url that caused the error
This commit is contained in:
Родитель
a5309d33cf
Коммит
9f5290f2fa
|
@ -46,6 +46,10 @@ suite('ConsoleHelper', () => {
|
|||
doAssert(Console.makeLog('test', null, undefined), 'test null undefined');
|
||||
});
|
||||
|
||||
test('network error', () => {
|
||||
doAssert(Console.makeNetworkLog('neterror', 'myurl'), 'neterror (myurl)', true);
|
||||
})
|
||||
|
||||
test('objects- waiting on VS Code bug 20343');
|
||||
});
|
||||
|
||||
|
@ -106,4 +110,8 @@ namespace Console {
|
|||
const fakeStackTrace = [{ url: '/script/a.js', lineNumber: 4, functionName: 'myFn' }];
|
||||
return makeMockMessage('assert', params, { level: 'error', stackTrace: fakeStackTrace });
|
||||
}
|
||||
|
||||
export function makeNetworkLog(text: string, url: string): WebKitProtocol.Console.Message {
|
||||
return makeMockMessage('log', [text], { source: 'network', url, level: 'error' });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,9 @@ export function formatConsoleMessage(m: WebKitProtocol.Console.Message): { text:
|
|||
let outputText: string;
|
||||
if (m.type === 'log') {
|
||||
outputText = resolveParams(m);
|
||||
if (m.source === 'network') {
|
||||
outputText += ` (${m.url})`;
|
||||
}
|
||||
} else if (m.type === 'assert') {
|
||||
outputText = 'Assertion failed';
|
||||
if (m.parameters && m.parameters.length) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче