當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript vscode-chrome-debug-core-testsupport.ExtendedDebugClient類代碼示例

本文整理匯總了TypeScript中vscode-chrome-debug-core-testsupport.ExtendedDebugClient的典型用法代碼示例。如果您正苦於以下問題:TypeScript ExtendedDebugClient類的具體用法?TypeScript ExtendedDebugClient怎麽用?TypeScript ExtendedDebugClient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ExtendedDebugClient類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: suite

suite('Chrome Debug Adapter etc', () => {
    let dc: ExtendedDebugClient;
    setup(() => {
        return testSetup.setup()
            .then(_dc => dc = _dc);
    });

    teardown(() => {
        return testSetup.teardown();
    });

    suite('basic', () => {
        test('unknown request should produce error', done => {
            dc.send('illegal_request').then(() => {
                done(new Error('does not report error on unknown request'));
            }).catch(() => {
                done();
            });
        });
    });

    suite('initialize', () => {
        test('should return supported features', () => {
            return dc.initializeRequest().then(response => {
                assert.equal(response.body.supportsConfigurationDoneRequest, true);
            });
        });
    });

    suite('launch', () => {
        test('should stop on debugger statement in file:///, sourcemaps disabled', () => {
            const testProjectRoot = path.join(DATA_ROOT, 'intervalDebugger');
            const launchFile = path.join(testProjectRoot, 'index.html');
            const breakFile = path.join(testProjectRoot, 'out/app.js');
            const DEBUGGER_LINE = 2;

            return Promise.all([
                dc.configurationSequence(),
                dc.launch({ file: launchFile, sourceMaps: false }),
                dc.assertStoppedLocation('debugger_statement', { path: breakFile, line: DEBUGGER_LINE } )
            ]);
        });

        test('should stop on debugger statement in http://localhost', () => {
            const testProjectRoot = path.join(DATA_ROOT, 'intervalDebugger');
            const breakFile = path.join(testProjectRoot, 'src/app.ts');
            const DEBUGGER_LINE = 2;

            const server = createServer({ root: testProjectRoot });
            server.listen(7890);

            return Promise.all([
                dc.configurationSequence(),
                dc.launch({ url: 'http://localhost:7890', webRoot: testProjectRoot }),
                dc.assertStoppedLocation('debugger_statement', { path: breakFile, line: DEBUGGER_LINE } )
            ])
            .then(
                () => server.close(),
                e => {
                    server.close();
                    throw e;
                });
        });
    });
});
開發者ID:snailuncle,項目名稱:vscode-chrome-debug,代碼行數:65,代碼來源:adapter.test.ts

示例2: test

        test('should stop on debugger statement in file:///, sourcemaps disabled', () => {
            const testProjectRoot = path.join(DATA_ROOT, 'intervalDebugger');
            const launchFile = path.join(testProjectRoot, 'index.html');
            const breakFile = path.join(testProjectRoot, 'out/app.js');
            const DEBUGGER_LINE = 2;

            return Promise.all([
                dc.configurationSequence(),
                dc.launch({ file: launchFile, sourceMaps: false }),
                dc.assertStoppedLocation('debugger_statement', { path: breakFile, line: DEBUGGER_LINE } )
            ]);
        });
開發者ID:snailuncle,項目名稱:vscode-chrome-debug,代碼行數:12,代碼來源:adapter.test.ts


注:本文中的vscode-chrome-debug-core-testsupport.ExtendedDebugClient類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。