Fix tests
This commit is contained in:
Родитель
2db4f51d85
Коммит
1c74a14cde
|
@ -181,7 +181,6 @@ suite('Utilities', () => {
|
|||
|
||||
suite('webkitUrlToClientUrl()', () => {
|
||||
const TEST_CLIENT_PATH = 'c:/site/scripts/a.js';
|
||||
const TEST_WEBKIT_LOCAL_URL = 'file:///' + TEST_CLIENT_PATH;
|
||||
const TEST_WEBKIT_HTTP_URL = 'http://site.com/page/scripts/a.js';
|
||||
const TEST_CWD = 'c:/site';
|
||||
|
||||
|
@ -189,10 +188,6 @@ suite('Utilities', () => {
|
|||
return require(MODULE_UNDER_TEST);
|
||||
}
|
||||
|
||||
test('file:/// urls are returned canonicalized', () => {
|
||||
assert.equal(Utilities().webkitUrlToClientUrl('', TEST_WEBKIT_LOCAL_URL), TEST_CLIENT_PATH);
|
||||
});
|
||||
|
||||
test('an empty string is returned for a missing url', () => {
|
||||
assert.equal(Utilities().webkitUrlToClientUrl('', ''), '');
|
||||
});
|
||||
|
|
|
@ -222,7 +222,7 @@ suite('WebKitDebugAdapter', () => {
|
|||
// Just assert that the chrome path is some string with 'chrome' in the path, and there are >0 args
|
||||
assert(chromePath.toLowerCase().indexOf('chrome') >= 0);
|
||||
assert(args.indexOf('--remote-debugging-port=9222') >= 0);
|
||||
assert(args.indexOf('a.js') >= 0);
|
||||
assert(args.indexOf('c:/a.js') >= 0);
|
||||
assert(args.indexOf('abc') >= 0);
|
||||
assert(args.indexOf('def') >= 0);
|
||||
spawnCalled = true;
|
||||
|
@ -230,6 +230,8 @@ suite('WebKitDebugAdapter', () => {
|
|||
return { on: () => { } };
|
||||
}
|
||||
|
||||
// actual path.resolve returns system-dependent slashes
|
||||
mockery.registerMock('path', { resolve: (a, b) => a + b });
|
||||
mockery.registerMock('child_process', { spawn });
|
||||
mockery.registerMock('fs', { statSync: () => true });
|
||||
mockery.registerMock('os', {
|
||||
|
@ -258,7 +260,7 @@ suite('WebKitDebugAdapter', () => {
|
|||
});
|
||||
|
||||
function attach(wkda: _WebKitDebugAdapter): Promise<void> {
|
||||
return wkda.attach({ address: '127.0.0.1', port: 9222, cwd: '.' });
|
||||
return wkda.attach({ address: '127.0.0.1', port: 9222, cwd: 'c:/' });
|
||||
}
|
||||
|
||||
class DefaultMockWebKitConnection {
|
||||
|
|
|
@ -222,7 +222,7 @@ export class WebKitDebugAdapter implements IDebugAdapter {
|
|||
}
|
||||
|
||||
public attach(args: IAttachRequestArgs): Promise<void> {
|
||||
if (args.address !== 'localhost') {
|
||||
if (args.address !== 'localhost' && args.address !== '127.0.0.1') {
|
||||
return Promise.reject('Remote debugging is not supported');
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче