Skip to content

Commit

Permalink
Merge d237b04 into 6d5f72f
Browse files Browse the repository at this point in the history
  • Loading branch information
ByMsx committed Jan 1, 2020
2 parents 6d5f72f + d237b04 commit 458d42b
Show file tree
Hide file tree
Showing 117 changed files with 546 additions and 476 deletions.
11 changes: 9 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@
"experimentalObjectRestSpread": true
}
},
"parser": "typescript-eslint-parser",
"plugins": ["typescript"],
"parser": "@typescript-eslint/parser",
"plugins": [
"typescript"
],
"env": {
"es6": true,
"node": true
},
"settings": {
"react": {
"version": "16.7.18"
}
},
"rules": {
"typescript/type-annotation-spacing": [2, {
"before": false,
Expand Down
2 changes: 1 addition & 1 deletion bin/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function task(pkg) {
location: pkg.location,
published,
});
}
},
);
});
}
Expand Down
34 changes: 18 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
"cleanup:packages": "lerna clean --yes && lerna exec --parallel -- node ../../bin/cleanup",
"add-package-files": "lerna exec --no-sort -- node ../../bin/add-package-files",
"generate-readme": "lerna exec --no-sort -- node ../../bin/generate-readme",
"lint": "npm run lint:src && npm run lint:test",
"lint:src": "lerna exec --parallel --ignore=\"@testring/@(e2e-test-app)\" -- eslint \"./src/**/*.[tj]s\"",
"lint:test": "lerna exec --parallel --no-sort --ignore=\"@testring/@(ui-kit|types)\" -- eslint ./test/**/*.[tj]s",
"lint": "lerna exec --parallel --no-sort -- eslint ./**/*.ts",
"lint:fix": "lerna exec --parallel --no-sort --no-bail -- eslint --fix ./**/*.ts",
"test": "lerna exec --ignore=\"@testring/@(ui-kit|types|e2e-test-app)\" -- mocha --opts mocha.opts",
"test:watch": "lerna exec --ignore=\"@testring/@(ui-kit|types|e2e-test-app)\" --parallel -- mocha --opts mocha.opts --watch",
"test:e2e": "lerna run --stream --scope @testring/e2e-test-app e2e",
Expand All @@ -36,7 +35,7 @@
"publish:version": "lerna version --exact",
"publish:ci": "node ./bin/publish.js",
"storybook": "lerna run --stream --scope @testring/ui-kit storybook",
"check-deps": "check-deps:precommit && npm run check-deps:root && npm run check-deps:packages",
"check-deps": "npm run check-deps:precommit && npm run check-deps:root && npm run check-deps:packages",
"check-deps:precommit": "lerna exec -- node ../../bin/check-packages-versions",
"check-deps:root": "npm-check -u",
"check-deps:packages": "lerna exec --no-bail -- npm-check --no-color --no-emoji --ignore @testring/*",
Expand Down Expand Up @@ -72,22 +71,26 @@
]
},
"devDependencies": {
"@lerna/batch-packages": "3.13.0",
"@lerna/filter-packages": "3.13.0",
"@lerna/project": "3.13.1",
"@lerna/run-parallel-batches": "3.13.0",
"@lerna/batch-packages": "3.16.0",
"@lerna/filter-packages": "3.18.0",
"@lerna/project": "3.18.0",
"@lerna/run-parallel-batches": "3.16.0",
"@types/chai": "4.1.7",
"@types/mocha": "5.2.5",
"@types/node": "10.5.6",
"@types/node": "12.12.21",
"@typescript-eslint/parser": "2.14.0",
"babel-eslint": "10.0.1",
"chai": "4.2.0",
"coveralls": "3.0.2",
"eslint": "5.12.0",
"eslint-config-ringcentral": "0.3.1",
"eslint-plugin-react": "7.9.1",
"eslint": "6.8.0",
"eslint-config-ringcentral": "3.0.0",
"eslint-plugin-import": "2.19.1",
"eslint-plugin-react": "7.17.0",
"eslint-plugin-ringcentral": "3.0.0",
"eslint-plugin-sonarjs": "0.5.0",
"eslint-plugin-typescript": "0.14.0",
"glob": "7.1.3",
"lerna": "3.13.1",
"lerna": "3.20.1",
"lerna-update-wizard": "0.11.1",
"mocha": "5.2.0",
"npm-check": "5.9.0",
Expand All @@ -96,8 +99,7 @@
"pre-commit": "1.2.2",
"rimraf": "2.6.3",
"sinon": "7.2.2",
"ts-node": "7.0.1",
"typescript": "3.1.1",
"typescript-eslint-parser": "21.0.2"
"ts-node": "8.5.4",
"typescript": "3.7.3"
}
}
2 changes: 1 addition & 1 deletion packages/api/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function getValidCopyVmError(error) {
return error;
}

// TODO check signature
// TODO (flops) check signature
let tmpError = new Error(error.message);
tmpError.stack = error.stack;
return tmpError;
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/test-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class TestContext {
for (const customApplication of this.customApplications) {
if (!customApplication.isStopped()) {
requests.push(
customApplication.end()
customApplication.end(),
);
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/async-breakpoints/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"url": "https://github.com/ringcentral/testring/issues"
},
"devDependencies": {
"@types/node": "12.12.21",
"chai": "4.2.0"
}
}
10 changes: 5 additions & 5 deletions packages/async-breakpoints/src/async-breakpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ export class AsyncBreakpoints extends EventEmitter {

async waitForBreakpoint(
type: BreakpointsTypes,
hasBreakpointCallback: HasBreakpointCallback
hasBreakpointCallback: HasBreakpointCallback,
): Promise<void> {
if (this.breakpoints.has(type)) {
await hasBreakpointCallback(true);
return this.breakpoints.get(type) as Promise<void>;
} else {
}
await hasBreakpointCallback(false);
return Promise.resolve();
}

}


Expand All @@ -87,7 +87,7 @@ export class AsyncBreakpoints extends EventEmitter {
}

public async waitBeforeInstructionBreakpoint(
hasBreakpointCallback: HasBreakpointCallback = () => undefined
hasBreakpointCallback: HasBreakpointCallback = () => undefined,
): Promise<void> {
return this.waitForBreakpoint(
BreakpointsTypes.beforeInstruction,
Expand All @@ -109,7 +109,7 @@ export class AsyncBreakpoints extends EventEmitter {
}

public async waitAfterInstructionBreakpoint(
hasBreakpointCallback: HasBreakpointCallback = () => undefined
hasBreakpointCallback: HasBreakpointCallback = () => undefined,
): Promise<void> {
return this.waitForBreakpoint(
BreakpointsTypes.afterInstruction,
Expand Down
1 change: 1 addition & 0 deletions packages/async-breakpoints/test/async-breakpoints.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference types="mocha" />
/* eslint sonarjs/no-identical-functions: 0 */
import * as chai from 'chai';

import { AsyncBreakpoints, BreakStackError } from '../src';
Expand Down
1 change: 0 additions & 1 deletion packages/browser-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@testring/transport": "0.5.14",
"@testring/types": "0.5.14",
"@testring/utils": "0.5.14",
"@types/node": "10.5.6",
"@types/yargs": "12.0.0",
"yargs": "12.0.1"
},
Expand Down
30 changes: 19 additions & 11 deletions packages/browser-proxy/src/browser-proxy-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class BrowserProxyWorker implements IBrowserProxyWorker {
if (this.workerID === source) {
this.onCommandResponse(response);
}
}
},
);

this.transport.on(BrowserProxyMessageTypes.exception, (error, source) => {
Expand All @@ -68,11 +68,11 @@ export class BrowserProxyWorker implements IBrowserProxyWorker {
}

return resolve(response);
} else {
}
this.logger.error(`Browser Proxy controller: cannot find command with uid ${uid}`);

throw new ReferenceError(`Cannot find command with uid ${uid}`);
}

}

private onProxyConnect(): void {
Expand All @@ -96,7 +96,7 @@ export class BrowserProxyWorker implements IBrowserProxyWorker {
this.logger.debug(
'Browser Proxy controller: miss connection with child process',
'code', code,
'error', error
'error', error,
);


Expand All @@ -118,7 +118,7 @@ export class BrowserProxyWorker implements IBrowserProxyWorker {
uid,
command,
applicant,
}
},
).catch((err) => {
this.logger.error(err);
});
Expand All @@ -138,13 +138,21 @@ export class BrowserProxyWorker implements IBrowserProxyWorker {

this.worker.on('exit', this.onExit);

this.worker.stdout.on('data', (message) => {
this.logger.log(`[logged] ${message.toString()}`);
});
if (this.worker.stdout) {
this.worker.stdout.on('data', (message) => {
this.logger.log(`[logged] ${message.toString()}`);
});
} else {
this.logger.warn(`[logged] The STDOUT of worker ${this.workerID} is null`);
}

this.worker.stderr.on('data', (message) => {
this.logger.warn(`[logged] ${message.toString()}`);
});
if (this.worker.stderr) {
this.worker.stderr.on('data', (message) => {
this.logger.warn(`[logged] ${message.toString()}`);
});
} else {
this.logger.warn(`[logged] The STDERR of worker ${this.workerID} is null`);
}

this.transport.registerChild(this.workerID, this.worker);

Expand Down
16 changes: 8 additions & 8 deletions packages/browser-proxy/src/browser-proxy/browser-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class BrowserProxy {
constructor(
private transportInstance: ITransport,
pluginPath: string,
pluginConfig: any
pluginConfig: any,
) {
this.loadPlugin(pluginPath, pluginConfig);
this.registerCommandListener();
Expand All @@ -50,7 +50,7 @@ export class BrowserProxy {
} catch (error) {
this.transportInstance.broadcast(
BrowserProxyMessageTypes.exception,
error
error,
);
}
}
Expand All @@ -59,14 +59,14 @@ export class BrowserProxy {
private registerCommandListener() {
this.transportInstance.on(
BrowserProxyMessageTypes.execute,
(message) => this.onMessage(message)
(message) => this.onMessage(message),
);
}

private sendEmptyResponse(uid: string) {
this.transportInstance.broadcast(
BrowserProxyMessageTypes.response,
{ uid }
{ uid },
);
}

Expand All @@ -86,9 +86,9 @@ export class BrowserProxy {
) {
this.sendEmptyResponse(uid);
return;
} else {
}
throw new ReferenceError('Cannot find browser proxy plugin!');
}

}

if (command.action === BrowserProxyActions.kill) {
Expand All @@ -103,7 +103,7 @@ export class BrowserProxy {
uid,
response,
error: null,
}
},
);
} catch (error) {
this.transportInstance.broadcast<IBrowserProxyCommandResponse>(
Expand All @@ -112,7 +112,7 @@ export class BrowserProxy {
uid,
error,
response: null,
}
},
);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference types="mocha" />
/* eslint sonarjs/no-identical-functions: 0 */

import * as path from 'path';
import * as chai from 'chai';
Expand Down
9 changes: 5 additions & 4 deletions packages/browser-proxy/test/browser-proxy.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference types="mocha" />
/* eslint sonarjs/no-identical-functions: 0 */

import * as path from 'path';
import * as chai from 'chai';
Expand Down Expand Up @@ -40,7 +41,7 @@ describe('Browser proxy', () => {
uid,
applicant: 'test',
command: commandMock,
}
},
);
});

Expand All @@ -61,7 +62,7 @@ describe('Browser proxy', () => {
{
uid,
command: commandMock,
}
},
);
});

Expand All @@ -77,7 +78,7 @@ describe('Browser proxy', () => {
chai.expect(response).to.have.property('error');

callback();
}
},
);

transport.emit(
Expand All @@ -88,7 +89,7 @@ describe('Browser proxy', () => {
action: 'barrelRoll' as BrowserProxyActions,
arguments: ['foo', 'bar'],
},
}
},
);
});
});
1 change: 1 addition & 0 deletions packages/browser-proxy/test/fixtures/async-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ class AsyncPlugin {
}
}

// eslint-disable-next-line import/no-default-export
export default (config) => new AsyncPlugin();
1 change: 1 addition & 0 deletions packages/browser-proxy/test/fixtures/sync-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ class SyncPlugin {
}
}

// eslint-disable-next-line import/no-default-export
export default (config) => new SyncPlugin();
4 changes: 2 additions & 2 deletions packages/child-process/src/fork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ export async function fork(
if (IS_WIN) {
childProcess = spawn(
'node',
[...processArgs, ...getAdditionalParameters(filePath), filePath, childArg, ...args]
[...processArgs, ...getAdditionalParameters(filePath), filePath, childArg, ...args],
);
} else {
childProcess = spawn(
getExecutor(filePath),
[...processArgs, filePath, childArg, ...args]
[...processArgs, filePath, childArg, ...args],
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/child-process/src/resolve-binary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ function escapify(str) {
return path.normalize(str).split(/\\/).map(windowsQuotes).join('\\\\');
} else if (/[^-_.~/\w]/.test(str)) {
return '\'' + str.replace(/'/g, '\'"\'"\'') + '\'';
} else {
}
return str;
}

}

export function resolveBinary(name: string) {
Expand Down
File renamed without changes.

0 comments on commit 458d42b

Please sign in to comment.