use import mocha instead of <reference> for some tests

This commit is contained in:
Matt Bierner 2017-11-07 14:54:11 -08:00
parent a50a146651
commit 69832fddf6
20 changed files with 21 additions and 12 deletions

View file

@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as assert from 'assert';
import { Selection, workspace } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';
@ -221,13 +222,13 @@ m10
.hoo {
background:
}
}
}
`
return withRandomFileEditor(scssContentsNoExpand, 'scss', (editor, doc) => {
editor.selections = [
new Selection(1, 3, 1, 3), // outside rule
new Selection(5, 15, 5, 15) // in the value part of property value
new Selection(5, 15, 5, 15) // in the value part of property value
];
return expandEmmetAbbreviation(null).then(() => {
assert.equal(editor.document.getText(), scssContentsNoExpand);
@ -344,7 +345,7 @@ suite('Tests for Wrap with Abbreviations', () => {
suite('Tests for jsx, xml and xsl', () => {
teardown(closeAllEditors);
test('Expand abbreviation with className instead of class in jsx', () => {
return withRandomFileEditor('ul.nav', 'javascriptreact', (editor, doc) => {
editor.selection = new Selection(0, 6, 0, 6);

View file

@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as assert from 'assert';
import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';
@ -18,7 +19,7 @@ suite('Tests for Next/Previous Select/Edit point and Balance actions', () => {
margin: 20px 10px;
background-image: url('tryme.png');
}
.boo .hoo {
margin: 10px;
}
@ -45,7 +46,7 @@ suite('Tests for Next/Previous Select/Edit point and Balance actions', () => {
</head>
<body>
<div>
</div>
<div class="header">
<ul class="nav main">

View file

@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as assert from 'assert';
import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';

View file

@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as assert from 'assert';
import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';

View file

@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as assert from 'assert';
import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';

View file

@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as assert from 'assert';
import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';

View file

@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as assert from 'assert';
import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';

View file

@ -5,4 +5,3 @@
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference types='@types/node'/>
/// <reference types='@types/mocha'/>

View file

@ -5,6 +5,7 @@
'use strict';
import 'mocha';
import { GitStatusParser } from '../git';
import * as assert from 'assert';

View file

@ -6,4 +6,3 @@
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>
/// <reference types='@types/node'/>
/// <reference types='@types/mocha'/>

View file

@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'mocha';
import * as assert from 'assert';
import * as embeddedSupport from '../modes/embeddedSupport';
import { TextDocument } from 'vscode-languageserver-types';

View file

@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'mocha';
import * as path from 'path';
import * as fs from 'fs';

View file

@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'mocha';
import * as assert from 'assert';
import { getJavascriptMode } from '../modes/javascriptMode';
import { TextDocument } from 'vscode-languageserver-types';

View file

@ -1 +0,0 @@
/// <reference types='@types/mocha'/>

View file

@ -5,6 +5,7 @@
'use strict';
import 'mocha';
import * as assert from 'assert';
import { join } from 'path';
import { commands, workspace, window, Uri, ViewColumn, Range, Position } from 'vscode';

View file

@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as assert from 'assert';
import * as vscode from 'vscode';

View file

@ -4,5 +4,4 @@
*--------------------------------------------------------------------------------------------*/
/// <reference path="../../../../src/vs/vscode.d.ts" />
/// <reference types='@types/mocha'/>
/// <reference types='@types/node'/>

View file

@ -5,6 +5,7 @@
'use strict';
import 'mocha';
import * as assert from 'assert';
import { commands, Uri } from 'vscode';
import { join, basename, normalize, dirname } from 'path';

View file

@ -3,5 +3,4 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference types='@types/mocha'/>
/// <reference types='@types/node'/>

View file

@ -19,11 +19,11 @@ import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorIn
import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
let activeEditor: BaseEditor = <any>{
let activeEditor: BaseEditor = {
getSelection: function () {
return 'test.selection';
}
};
} as any;
let openedEditorInput: EditorInput;
let openedEditorOptions: EditorOptions;