@eclipse-glsp/server 2.8.0-next.5 → 2.8.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/lib/common/features/directediting/context-edit-validator.js +3 -3
  2. package/lib/common/features/directediting/context-edit-validator.js.map +1 -1
  3. package/package.json +8 -8
  4. package/src/common/features/directediting/context-edit-validator.ts +2 -2
  5. package/src/browser/di/browser-action-dispatch-scope.spec.ts +0 -75
  6. package/src/common/actions/action-handler-registry.spec.ts +0 -52
  7. package/src/common/actions/global-action-provider.spec.ts +0 -68
  8. package/src/common/command/command-stack.spec.ts +0 -239
  9. package/src/common/command/command.spec.ts +0 -92
  10. package/src/common/command/recording-command.spec.ts +0 -86
  11. package/src/common/di/binding-target.spec.ts +0 -147
  12. package/src/common/di/multi-bindings.spec.ts +0 -133
  13. package/src/common/features/contextactions/context-actions-provider-registry.spec.ts +0 -69
  14. package/src/common/features/contextactions/request-context-actions-handler.spec.ts +0 -75
  15. package/src/common/features/contextactions/tool-palette-item-provider.spec.ts +0 -46
  16. package/src/common/features/directediting/context-edit-validator-registry.spec.ts +0 -54
  17. package/src/common/features/directediting/request-edit-validation-handler.spec.ts +0 -131
  18. package/src/common/features/model/gmodel-serializer.spec.ts +0 -141
  19. package/src/common/features/type-hints/request-type-hints-action-handler.spec.ts +0 -59
  20. package/src/common/operations/operation-handler-registry.spec.ts +0 -50
  21. package/src/common/protocol/glsp-server.spec.ts +0 -154
  22. package/src/common/session/client-session-factory.spec.ts +0 -60
  23. package/src/common/session/client-session-manager.spec.ts +0 -83
  24. package/src/common/test/mock-util.ts +0 -281
  25. package/src/common/utils/action-queue.spec.ts +0 -133
  26. package/src/common/utils/promise-queue.spec.ts +0 -142
  27. package/src/common/utils/registry.spec.ts +0 -225
  28. package/src/node/actions/action-dispatcher.spec.ts +0 -678
  29. package/src/node/launch/cli-parser.spec.ts +0 -61
  30. package/src/node/launch/socket-cli-parser.spec.ts +0 -73
  31. package/src/node/launch/socket-server-launcher.spec.ts +0 -74
@@ -1,61 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (c) 2022-2023 STMicroelectronics and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
- import { expect } from 'chai';
17
- import * as path from 'path';
18
- import { LogLevel } from '../../common/utils/logger';
19
- import { createCliParser, defaultLaunchOptions } from './cli-parser';
20
-
21
- describe('test createCliParser', () => {
22
- const parser = createCliParser();
23
-
24
- parser.command.exitOverride();
25
- const argv = ['/usr/bin/node', 'test'];
26
-
27
- it('parse - no args', () => {
28
- const options = parser.parse(argv);
29
- expect(options).to.deep.equal(defaultLaunchOptions);
30
- });
31
-
32
- it('parse - invalid log dir', () => {
33
- expect(() => parser.parse([...argv, '--logDir', 'invalid.Path'])).to.throw();
34
- });
35
-
36
- it('parse - valid log dir', () => {
37
- const logDir = path.resolve('../customLog');
38
- const result = parser.parse([...argv, '--logDir', '../customLog/']);
39
- expect(result.logDir, logDir);
40
- });
41
-
42
- it('parse - invalid logLevel', () => {
43
- expect(() => parser.parse([...argv, '--logLevel', 'someRandomLevel'])).to.throw();
44
- });
45
-
46
- it('parse - valid logLevel', () => {
47
- const result = parser.parse([...argv, '--logLevel', 'error']);
48
- expect(result.logLevel).to.be.equal(LogLevel.error);
49
- });
50
-
51
- it('parse- no args with custom default options', () => {
52
- const options = {
53
- logDir: '.myLogDir',
54
- logLevel: LogLevel.debug,
55
- consoleLog: false,
56
- fileLog: true
57
- };
58
- const result = createCliParser(options).parse(argv);
59
- expect(result).to.deep.equal(options);
60
- });
61
- });
@@ -1,73 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (c) 2022-2023 STMicroelectronics and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
- import { expect } from 'chai';
17
- import { LogLevel } from '../../common/utils/logger';
18
- import { createSocketCliParser, defaultSocketLaunchOptions, SocketLaunchOptions } from './socket-cli-parser';
19
-
20
- describe('test createCliParser', () => {
21
- const parser = createSocketCliParser();
22
-
23
- parser.command.exitOverride();
24
- const argv = ['/usr/bin/node', 'test'];
25
-
26
- it('parse - no args', () => {
27
- const options = parser.parse(argv);
28
- expect(options).to.deep.equal(defaultSocketLaunchOptions);
29
- });
30
-
31
- it('parse - invalid port (below lower range)', () => {
32
- expect(() => parser.parse([...argv, '--port', '-1'])).to.throw();
33
- });
34
-
35
- it('parse - invalid port (below upper range)', () => {
36
- expect(() => parser.parse([...argv, '--port', '65536'])).to.throw();
37
- });
38
-
39
- it('parse - valid port', () => {
40
- const port = 3000;
41
- const result = parser.parse([...argv, '--port', '3000']);
42
- expect(result.port).to.equal(port);
43
- });
44
-
45
- it('parse - --no-consoleLog', () => {
46
- const result = parser.parse([...argv, '--no-consoleLog']);
47
- expect(result.consoleLog).false;
48
- });
49
-
50
- it('parse - --fileLog', () => {
51
- const result = parser.parse([...argv, '--fileLog']);
52
- expect(result.fileLog).true;
53
- });
54
-
55
- it('parse - custom host name', () => {
56
- const host = 'docker.internal';
57
- const result = parser.parse([...argv, '--host', host]);
58
- expect(result.host, host);
59
- });
60
-
61
- it('parse- no args with custom default options', () => {
62
- const options: SocketLaunchOptions = {
63
- logDir: '.myLogDir',
64
- logLevel: LogLevel.debug,
65
- consoleLog: true,
66
- fileLog: true,
67
- host: 'myHost',
68
- port: 3000
69
- };
70
- const result = createSocketCliParser(options).parse(argv);
71
- expect(result).to.deep.equal(options);
72
- });
73
- });
@@ -1,74 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (c) 2022-2023 STMicroelectronics and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
-
17
- import { GLSPServer } from '@eclipse-glsp/protocol';
18
- import { expect } from 'chai';
19
- import { Container } from 'inversify';
20
- import * as net from 'net';
21
- import * as sinon from 'sinon';
22
- import { DefaultGLSPServer } from '../../common/protocol/glsp-server';
23
- import { createAppModule } from '../di/app-module';
24
- import { defaultSocketLaunchOptions } from './socket-cli-parser';
25
- import { SocketServerLauncher } from './socket-server-launcher';
26
- const severPort = 5008;
27
- describe('test SocketServerLauncher', () => {
28
- it('starts and stops', async () => {
29
- const appContainer = new Container();
30
- const serverStub = sinon.createStubInstance(DefaultGLSPServer);
31
- appContainer.load(createAppModule(defaultSocketLaunchOptions));
32
-
33
- appContainer.bind(GLSPServer).toConstantValue(serverStub);
34
- const launcher = appContainer.resolve(SocketServerLauncher);
35
- launcher.start({ port: severPort });
36
- const sockStart = new net.Socket();
37
- sockStart.setTimeout(100);
38
- const startPromise = new Promise(res => {
39
- sockStart
40
- .on('connect', () => {
41
- expect(true);
42
- sockStart.destroy();
43
- res(true);
44
- })
45
- .on('error', e => {
46
- expect.fail('Server is not reachable: ' + e.message);
47
- })
48
- .on('timeout', () => {
49
- expect.fail('Connection time outed.');
50
- })
51
- .connect(severPort);
52
- });
53
- await startPromise;
54
- launcher.shutdown();
55
- const sockStop = new net.Socket();
56
- sockStop.setTimeout(100);
57
- const stopPromise = new Promise(res => {
58
- sockStop
59
- .on('connect', () => {
60
- expect.fail('Server still reachable.');
61
- })
62
- .on('error', () => {
63
- expect(true);
64
- sockStop.destroy();
65
- res(true);
66
- })
67
- .on('timeout', () => {
68
- expect.fail('Connection time outed.');
69
- })
70
- .connect(severPort);
71
- });
72
- await stopPromise;
73
- });
74
- });