window.test.ts 899 字节
Newer Older
E
Erich Gamma 已提交
1 2 3 4 5 6 7 8
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

'use strict';

import * as assert from 'assert';
B
Benjamin Pasero 已提交
9 10
import {workspace, window} from 'vscode';
import {join} from 'path';
11
import {cleanUp} from './utils';
E
Erich Gamma 已提交
12

B
Benjamin Pasero 已提交
13
suite("window namespace tests", () => {
E
Erich Gamma 已提交
14

15
	teardown(cleanUp);
16

17 18
	test('active text editor', () => {
		return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => {
B
Benjamin Pasero 已提交
19 20 21 22 23
			return window.showTextDocument(doc).then((editor) => {
				const active = window.activeTextEditor;
				assert.ok(active);
				assert.equal(active.document.uri.fsPath, doc.uri.fsPath);
			});
24
		});
B
Benjamin Pasero 已提交
25
	});
E
Erich Gamma 已提交
26
});