This commit is contained in:
Rob 2015-10-28 16:54:07 -07:00
Родитель 9231c877d0
Коммит 94d3ef4517
2 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -11,6 +11,7 @@ const AUTHORED_PATH = 'authored.ts';
const RUNTIME_PATH = 'runtime.js';
const AUTHORED_LINES = [1, 2, 3];
const RUNTIME_LINES = [2, 5, 8];
const RUNTIME_COLS = [3, 7, 11];
suite('SourceMapTransformer', () => {
let transformer: IDebugTransformer;
@ -45,16 +46,17 @@ suite('SourceMapTransformer', () => {
});
suite('setBreakpoints()', () => {
function createArgs(path: string, lines: number[]): DebugProtocol.SetBreakpointsArguments {
function createArgs(path: string, lines: number[], cols?: number[]): ISetBreakpointsArgs {
return {
source: { path },
lines
lines,
cols
};
}
test('modifies the source and lines', () => {
const args = createArgs(AUTHORED_PATH, AUTHORED_LINES);
const expected = createArgs(RUNTIME_PATH, RUNTIME_LINES);
const expected = createArgs(RUNTIME_PATH, RUNTIME_LINES, RUNTIME_COLS);
transformer.setBreakpoints(args);
assert.deepEqual(args, expected);
@ -155,8 +157,10 @@ class MockSourceMaps implements ISourceMaps {
assert.equal(path, AUTHORED_PATH);
assert.equal(column, 0);
const mappedLine = RUNTIME_LINES[AUTHORED_LINES.indexOf(line)];
return { path: RUNTIME_PATH, line: mappedLine, column: 0 };
const index = AUTHORED_LINES.indexOf(line);
const mappedLine = RUNTIME_LINES[index];
const mappedCol = RUNTIME_COLS[index];
return { path: RUNTIME_PATH, line: mappedLine, column: mappedCol };
}
/*

Просмотреть файл

@ -3,10 +3,6 @@
*--------------------------------------------------------*/
import * as mockery from 'mockery';
import * as assert from 'assert';
/** Utilities without mocks - use for type only */
import * as _Utilities from '../../webkit/webKitDebugAdapter';
const MODULE_UNDER_TEST = '../../webkit/webKitDebugAdapter';
suite('WebKitDebugAdapter', () => {
@ -30,6 +26,5 @@ suite('WebKitDebugAdapter', () => {
});
suite('launch()', () => {
});
});