Skip to content

Commit 9c25be6

Browse files
committed
fix: clear out test inconsistencies
1 parent 0aa66d7 commit 9c25be6

File tree

4 files changed

+9
-41
lines changed

4 files changed

+9
-41
lines changed

.vscode-test.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ let createCommonOptions = (label) => {
3737

3838
mocha: {
3939
ui: 'bdd',
40+
timeout: 60_000,
4041
},
4142
};
4243
}

src/extract/evaluate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ export async function extractWithEvaluation(
8787
try {
8888
const startMapped = originalPositionFor(sourceMap, {
8989
line: startLine,
90-
column: startColumn,
90+
column: startColumn - 1,
9191
});
9292
if (startMapped.line !== null) {
9393
startLine = startMapped.line;
9494
startColumn = startMapped.column + 1; // columns are 0-based in trace-mapping lib
9595
}
9696
const endMapped = originalPositionFor(sourceMap, {
9797
line: endLine,
98-
column: endColumn,
98+
column: endColumn - 1,
9999
});
100100
if (endMapped.line !== null) {
101101
endLine = endMapped.line;

src/source-map.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,26 @@ const smUrlComment = '//# sourceMappingURL=';
1313

1414
export interface IMappingAccessor {
1515
/**
16-
* @param line base-1 line
16+
* @param line base-0 line
1717
* @param col base-0 column
1818
*/
1919
originalPositionFor(line: number, col: number): vscode.Location;
2020
}
2121

2222
export const identityMapping = (file: vscode.Uri): IMappingAccessor => ({
2323
originalPositionFor(line, col) {
24-
// VS Code positions are base 0, adjust the line
2524
return new vscode.Location(file, new vscode.Position(line, col));
2625
},
2726
});
2827

2928
const smMappingAccessor = (file: vscode.Uri, sm: TraceMap): IMappingAccessor => ({
3029
originalPositionFor(line, column) {
31-
const { source, line: smLine, column: smCol } = originalPositionFor(sm, { line, column });
30+
const {
31+
source,
32+
line: smLine,
33+
column: smCol,
34+
} = originalPositionFor(sm, { line: line + 1, column: column });
3235
if (!source) {
33-
// VS Code positions are base 0, adjust the line
3436
return new vscode.Location(file, new vscode.Position(line, column));
3537
}
3638

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,7 @@
11
const { strictEqual } = require('node:assert');
22

33
describe('math', () => {
4-
54
it('division', async () => {
65
strictEqual(2 / 1, 2);
76
});
8-
9-
it('test', ()=>{ })
10-
11-
it('test2', ()=>{ })
12-
13-
14-
15-
16-
17-
18-
19-
20-
it('test3', ()=>{ })
21-
227
});
23-
24-
25-
describe('xx', async () => {
26-
27-
28-
29-
it('test', ()=>{ })
30-
31-
it('test2', ()=>{ })
32-
33-
34-
35-
36-
37-
38-
39-
40-
it('test3', ()=>{ })
41-
42-
})

0 commit comments

Comments
 (0)