Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Bump core, add tests for microsoft/vscode#54026
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Jul 17, 2018
1 parent 921d0fb commit 488e5ef
Show file tree
Hide file tree
Showing 10 changed files with 1,226 additions and 1,090 deletions.
2,178 changes: 1,089 additions & 1,089 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"license": "MIT",
"private": true,
"dependencies": {
"vscode-chrome-debug-core": "^6.6.0",
"vscode-chrome-debug-core": "^6.7.0",
"vscode-debugadapter": "^1.30.0-pre.2",
"vscode-nls": "^3.2.1"
},
Expand Down
28 changes: 28 additions & 0 deletions test/breakpoints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import * as assert from 'assert';
import * as child_process from 'child_process';
import * as path from 'path';
import { DebugProtocol } from 'vscode-debugprotocol';
import * as ts from 'vscode-chrome-debug-core-testsupport';
Expand Down Expand Up @@ -306,6 +307,33 @@ suite('Breakpoints', () => {

await dc.continueTo('breakpoint', { line: BP_LINE, path: PROGRAM });
});

const execP = (command, options) => {
return new Promise((resolve, reject) => {
child_process.exec(command, options, (err, stdout) => {
if (err) {
return reject(err);
}

resolve(stdout);
});
});
};

test('still resolves sourcemap paths when they are absolute local paths', async () => {
const TEST_ROOT = path.join(DATA_ROOT, 'sourcemaps-local-paths');

await execP('npm install', { cwd: TEST_ROOT });
const PROGRAM = path.join(DATA_ROOT, 'sourcemaps-local-paths/out/classes.js');
const TS_SOURCE = path.join(DATA_ROOT, 'sourcemaps-local-paths/src/classes.ts');
const TS_LINE = 17;

return dc.hitBreakpointUnverified({
program: PROGRAM,
outFiles: [path.join(DATA_ROOT, 'sourcemaps-local-paths/out/*.js')],
runtimeArgs: ['--nolazy']
}, { path: TS_SOURCE, line: TS_LINE });
});
});

suite('setExceptionBreakpoints', () => {
Expand Down
18 changes: 18 additions & 0 deletions testdata/sourcemaps-local-paths/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
// "debugServer": 4712,
"type": "node",
"request": "launch",
"name": "Launch Program",
"outFiles": [
"${workspaceFolder}/out/*.js"
],
"program": "${workspaceFolder}/out/classes.js"
}
]
}
32 changes: 32 additions & 0 deletions testdata/sourcemaps-local-paths/out/classes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions testdata/sourcemaps-local-paths/out/classes.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions testdata/sourcemaps-local-paths/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions testdata/sourcemaps-local-paths/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "sourcemaps-local-paths",
"version": "1.0.0",
"description": "",
"author": "roblourens",
"license": "MIT",
"scripts": {
"postinstall": "tsc"
},
"dependencies": {
"typescript": "2.9.2"
}
}
23 changes: 23 additions & 0 deletions testdata/sourcemaps-local-paths/src/classes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class Foo {

private _name: string;

constructor(name: string) {
this._name = name;
}

getName(): string {
return this._name;
}
}

class Bar extends Foo {

getName(): string {
return super.getName() + ' Doe';
}
}

const bar = new Bar('John2');

console.log(bar.getName()); // John Doe
8 changes: 8 additions & 0 deletions testdata/sourcemaps-local-paths/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"sourceRoot": "src",
"mapRoot": "out",
"outDir": "out",
"sourceMap": true
}
}

0 comments on commit 488e5ef

Please sign in to comment.