Skip to content

Commit

Permalink
Merge pull request #66436 from fuafa/findModel
Browse files Browse the repository at this point in the history
add strict null checks to findModel.test.ts
  • Loading branch information
mjbvz authored Jan 15, 2019
2 parents dae8c42 + bf06d8c commit 4f0d09d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/tsconfig.strictNullChecks.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
"./vs/editor/contrib/find/simpleFindWidget.ts",
"./vs/editor/contrib/find/test/find.test.ts",
"./vs/editor/contrib/find/test/findController.test.ts",
"./vs/editor/contrib/find/test/findModel.test.ts",
"./vs/editor/contrib/find/test/replacePattern.test.ts",
"./vs/editor/contrib/folding/folding.ts",
"./vs/editor/contrib/folding/foldingDecorations.ts",
Expand Down
10 changes: 6 additions & 4 deletions src/vs/editor/contrib/find/test/findModel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import * as assert from 'assert';
import { CoreNavigationCommands } from 'vs/editor/browser/controller/coreCommands';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { ICodeEditor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';
import { Cursor } from 'vs/editor/common/controller/cursor';
import { Position } from 'vs/editor/common/core/position';
import { Range } from 'vs/editor/common/core/range';
Expand All @@ -18,7 +18,7 @@ import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor';

suite('FindModel', () => {

function findTest(testName: string, callback: (editor: ICodeEditor, cursor: Cursor) => void): void {
function findTest(testName: string, callback: (editor: IActiveCodeEditor, cursor: Cursor) => void): void {
test(testName, () => {
const textArr = [
'// my cool header',
Expand All @@ -34,7 +34,7 @@ suite('FindModel', () => {
'// blablablaciao',
''
];
withTestCodeEditor(textArr, {}, callback);
withTestCodeEditor(textArr, {}, (editor, cursor) => callback(editor as unknown as IActiveCodeEditor, cursor));

const text = textArr.join('\n');
const ptBuilder = new PieceTreeTextBufferBuilder();
Expand All @@ -45,7 +45,9 @@ suite('FindModel', () => {
withTestCodeEditor([],
{
model: new TextModel(factory, TextModel.DEFAULT_CREATION_OPTIONS, null, null)
}, callback);
},
(editor, cursor) => callback(editor as unknown as IActiveCodeEditor, cursor)
);
});
}

Expand Down

0 comments on commit 4f0d09d

Please sign in to comment.