UNPKG

1.79 kBJavaScriptView Raw
1"use strict";
2// *****************************************************************************
3// Copyright (C) 2017 TypeFox and others.
4//
5// This program and the accompanying materials are made available under the
6// terms of the Eclipse Public License v. 2.0 which is available at
7// http://www.eclipse.org/legal/epl-2.0.
8//
9// This Source Code may also be made available under the following Secondary
10// Licenses when the conditions for such availability set forth in the Eclipse
11// Public License v. 2.0 are satisfied: GNU General Public License, version 2
12// with the GNU Classpath Exception which is available at
13// https://www.gnu.org/software/classpath/license.html.
14//
15// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16// *****************************************************************************
17Object.defineProperty(exports, "__esModule", { value: true });
18const selection_service_1 = require("./selection-service");
19const chai = require("chai");
20const expect = chai.expect;
21describe('selection-service', () => {
22 describe('01 #addListener and dispose', () => {
23 it('Should be rejected when path argument is undefined.', () => {
24 const service = createSelectionService();
25 // eslint-disable-next-line @typescript-eslint/no-explicit-any
26 const events = [];
27 const disposable = service.onSelectionChanged(e => events.push(e));
28 service.selection = 'foo';
29 disposable.dispose();
30 service.selection = 'bar';
31 expect(events.length).equals(1);
32 expect(events[0]).equals('foo');
33 });
34 });
35});
36function createSelectionService() {
37 return new selection_service_1.SelectionService();
38}
39//# sourceMappingURL=selection-service.spec.js.map
\No newline at end of file