diff --git a/.gitignore b/.gitignore index 598c8f2..282326e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,12 @@ .DS_Store -node_modules/ -out/ -lib/ -*.vsix -vscode-chrome-debug.txt -typings/ .browse.VC.db +vscode-chrome-debug.txt +npm-debug.log +*.vsix + +lib/ +node_modules/ +/out/ +typings/ testapp/.vscode/chrome -npm-debug.log \ No newline at end of file +testapp/**/out/ \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 88baf8f..a3e62d5 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -24,7 +24,8 @@ "args": [ "-u", "tdd", "--colors", - "out/test/**/*.test.js" + "out/test/**/*.test.js", + "--timeout", "1800000" ], "sourceMaps": true, "outFiles": ["${workspaceRoot}/out/**/*.js"] diff --git a/test/int/adapter.test.ts b/test/int/adapter.test.ts index cc2758c..779ba66 100644 --- a/test/int/adapter.test.ts +++ b/test/int/adapter.test.ts @@ -8,13 +8,11 @@ import * as path from 'path'; const {createServer} = require('http-server'); import {DebugClient} from 'vscode-debugadapter-testsupport'; -import {DebugProtocol} from 'vscode-debugprotocol'; import * as testUtils from './intTestUtils'; import * as testSetup from './testSetup'; const DATA_ROOT = testSetup.DATA_ROOT; -const THREAD_ID = testUtils.THREAD_ID; suite('Chrome Debug Adapter etc', () => { let dc: DebugClient; @@ -49,7 +47,7 @@ suite('Chrome Debug Adapter etc', () => { test('should stop on debugger statement in file:///', () => { const testProjectRoot = path.join(DATA_ROOT, 'intervalDebugger'); const launchFile = path.join(testProjectRoot, 'index.html'); - const breakFile = path.join(testProjectRoot, 'app.js'); + const breakFile = path.join(testProjectRoot, 'out/app.js'); const DEBUGGER_LINE = 2; return Promise.all([ @@ -61,18 +59,23 @@ suite('Chrome Debug Adapter etc', () => { test('should stop on debugger statement in http://localhost', () => { const testProjectRoot = path.join(DATA_ROOT, 'intervalDebugger'); - const breakFile = path.join(testProjectRoot, 'app.js'); + const breakFile = path.join(testProjectRoot, 'out/app.js'); const DEBUGGER_LINE = 2; - const server = createServer({ root: testProjectRoot }) - .listen(7890); + const server = createServer({ root: testProjectRoot }); + server.listen(7890); return Promise.all([ dc.configurationSequence(), - dc.launch({ url: 'http://localhost:7890' }), + dc.launch({ url: 'http://localhost:7890', webRoot: testProjectRoot }), dc.assertStoppedLocation('debugger statement', { path: breakFile, line: DEBUGGER_LINE } ) ]) - .then(() => server.close()); + .then( + () => server.close(), + e => { + server.close(); + throw e; + }); }); }); }); \ No newline at end of file diff --git a/testdata/intervalDebugger/index.html b/testdata/intervalDebugger/index.html index c41df5c..424fe48 100644 --- a/testdata/intervalDebugger/index.html +++ b/testdata/intervalDebugger/index.html @@ -1,8 +1,8 @@ - + -

Hello, world!

+

testdata/intervalDebugger

\ No newline at end of file diff --git a/testdata/intervalDebugger/out/app.js b/testdata/intervalDebugger/out/app.js new file mode 100644 index 0000000..8a42716 --- /dev/null +++ b/testdata/intervalDebugger/out/app.js @@ -0,0 +1,5 @@ +function debuggerStatement() { + debugger; +} +setInterval(debuggerStatement, 100); +//# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/testdata/intervalDebugger/out/app.js.map b/testdata/intervalDebugger/out/app.js.map new file mode 100644 index 0000000..bfc1cc7 --- /dev/null +++ b/testdata/intervalDebugger/out/app.js.map @@ -0,0 +1 @@ +{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA;IACI,QAAQ,CAAC;AACb,CAAC;AAED,WAAW,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/testdata/intervalDebugger/app.js b/testdata/intervalDebugger/src/app.ts similarity index 100% rename from testdata/intervalDebugger/app.js rename to testdata/intervalDebugger/src/app.ts diff --git a/testdata/intervalDebugger/tsconfig.json b/testdata/intervalDebugger/tsconfig.json new file mode 100644 index 0000000..ab7bb8c --- /dev/null +++ b/testdata/intervalDebugger/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "sourceMap": true, + "outDir": "out" + } +} \ No newline at end of file