Adopt new mocha types

上级 f74ad969
...@@ -1272,8 +1272,7 @@ suite('regression', () => { ...@@ -1272,8 +1272,7 @@ suite('regression', () => {
assert.strictEqual(vscode.window.activeNotebookEditor!.document.uri.toString(), resource.toString()); assert.strictEqual(vscode.window.activeNotebookEditor!.document.uri.toString(), resource.toString());
}); });
test('Cannot open notebook from cell-uri with vscode.open-command', async function () { test.skip('Cannot open notebook from cell-uri with vscode.open-command', async function () {
this.skip();
assertInitalState(); assertInitalState();
const resource = await createRandomFile('', undefined, 'first', '.vsctestnb'); const resource = await createRandomFile('', undefined, 'first', '.vsctestnb');
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest'); await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
......
...@@ -576,12 +576,12 @@ suite('Async', () => { ...@@ -576,12 +576,12 @@ suite('Async', () => {
sequentializer.setPending(2, async.timeout(1)); sequentializer.setPending(2, async.timeout(1));
assert.ok(sequentializer.hasPending()); assert.ok(sequentializer.hasPending());
assert.ok(sequentializer.hasPending(2)); assert.ok(sequentializer.hasPending(2));
assert.ok(!sequentializer.hasPending(1)); assert.strictEqual(sequentializer.hasPending(1), false);
assert.ok(sequentializer.pending); assert.ok(sequentializer.pending);
await async.timeout(2); await async.timeout(2);
assert.ok(!sequentializer.hasPending()); assert.strictEqual(sequentializer.hasPending(), false);
assert.ok(!sequentializer.hasPending(2)); assert.strictEqual(sequentializer.hasPending(2), false);
assert.ok(!sequentializer.pending); assert.ok(!sequentializer.pending);
}); });
......
...@@ -9,7 +9,7 @@ const patterns = ['cci', 'ida', 'pos', 'CCI', 'enbled', 'callback', 'gGame', 'co ...@@ -9,7 +9,7 @@ const patterns = ['cci', 'ida', 'pos', 'CCI', 'enbled', 'callback', 'gGame', 'co
const _enablePerf = false; const _enablePerf = false;
function perfSuite(name: string, callback: (this: Mocha.ISuiteCallbackContext) => void) { function perfSuite(name: string, callback: (this: Mocha.Suite) => void) {
if (_enablePerf) { if (_enablePerf) {
suite(name, callback); suite(name, callback);
} }
......
...@@ -101,7 +101,6 @@ suite('PagedModel', () => { ...@@ -101,7 +101,6 @@ suite('PagedModel', () => {
test('preemptive cancellation works', async function () { test('preemptive cancellation works', async function () {
const pager = new TestPager(() => { const pager = new TestPager(() => {
assert(false); assert(false);
return Promise.resolve([]);
}); });
const model = new PagedModel(pager); const model = new PagedModel(pager);
......
...@@ -141,8 +141,7 @@ suite('SkipList', function () { ...@@ -141,8 +141,7 @@ suite('SkipList', function () {
} }
test('perf', function () { test.skip('perf', function () {
this.skip();
// data // data
const max = 2 ** 16; const max = 2 ** 16;
......
...@@ -57,7 +57,7 @@ suite('Types', () => { ...@@ -57,7 +57,7 @@ suite('Types', () => {
assert(!types.isObject(/test/)); assert(!types.isObject(/test/));
assert(!types.isObject(new RegExp(''))); assert(!types.isObject(new RegExp('')));
assert(!types.isFunction(new Date())); assert(!types.isFunction(new Date()));
assert(!types.isObject(assert)); assert.strictEqual(types.isObject(assert), false);
assert(!types.isObject(function foo() { })); assert(!types.isObject(function foo() { }));
assert(types.isObject({})); assert(types.isObject({}));
...@@ -75,7 +75,7 @@ suite('Types', () => { ...@@ -75,7 +75,7 @@ suite('Types', () => {
assert(!types.isEmptyObject(/test/)); assert(!types.isEmptyObject(/test/));
assert(!types.isEmptyObject(new RegExp(''))); assert(!types.isEmptyObject(new RegExp('')));
assert(!types.isEmptyObject(new Date())); assert(!types.isEmptyObject(new Date()));
assert(!types.isEmptyObject(assert)); assert.strictEqual(types.isEmptyObject(assert), false);
assert(!types.isEmptyObject(function foo() { /**/ })); assert(!types.isEmptyObject(function foo() { /**/ }));
assert(!types.isEmptyObject({ foo: 'bar' })); assert(!types.isEmptyObject({ foo: 'bar' }));
......
...@@ -444,8 +444,7 @@ suite('URI', () => { ...@@ -444,8 +444,7 @@ suite('URI', () => {
assert.equal(URI.parse('file://some/%A0.txt'), 'file://some/%25A0.txt'); assert.equal(URI.parse('file://some/%A0.txt'), 'file://some/%25A0.txt');
}); });
test('Links in markdown are broken if url contains encoded parameters #79474', function () { test.skip('Links in markdown are broken if url contains encoded parameters #79474', function () {
this.skip();
let strIn = 'https://myhost.com/Redirect?url=http%3A%2F%2Fwww.bing.com%3Fsearch%3Dtom'; let strIn = 'https://myhost.com/Redirect?url=http%3A%2F%2Fwww.bing.com%3Fsearch%3Dtom';
let uri1 = URI.parse(strIn); let uri1 = URI.parse(strIn);
let strOut = uri1.toString(); let strOut = uri1.toString();
...@@ -459,8 +458,7 @@ suite('URI', () => { ...@@ -459,8 +458,7 @@ suite('URI', () => {
assert.equal(strIn, strOut); // fails here!! assert.equal(strIn, strOut); // fails here!!
}); });
test('Uri#parse can break path-component #45515', function () { test.skip('Uri#parse can break path-component #45515', function () {
this.skip();
let strIn = 'https://firebasestorage.googleapis.com/v0/b/brewlangerie.appspot.com/o/products%2FzVNZkudXJyq8bPGTXUxx%2FBetterave-Sesame.jpg?alt=media&token=0b2310c4-3ea6-4207-bbde-9c3710ba0437'; let strIn = 'https://firebasestorage.googleapis.com/v0/b/brewlangerie.appspot.com/o/products%2FzVNZkudXJyq8bPGTXUxx%2FBetterave-Sesame.jpg?alt=media&token=0b2310c4-3ea6-4207-bbde-9c3710ba0437';
let uri1 = URI.parse(strIn); let uri1 = URI.parse(strIn);
let strOut = uri1.toString(); let strOut = uri1.toString();
......
...@@ -60,7 +60,7 @@ export function suiteRepeat(n: number, description: string, callback: (this: any ...@@ -60,7 +60,7 @@ export function suiteRepeat(n: number, description: string, callback: (this: any
} }
} }
export function testRepeat(n: number, description: string, callback: (this: any, done: MochaDone) => any): void { export function testRepeat(n: number, description: string, callback: (this: any) => any): void {
for (let i = 0; i < n; i++) { for (let i = 0; i < n; i++) {
test(`${description} (iteration ${i})`, callback); test(`${description} (iteration ${i})`, callback);
} }
......
...@@ -10,7 +10,6 @@ suite('Keytar', () => { ...@@ -10,7 +10,6 @@ suite('Keytar', () => {
test('loads and is functional', function (done) { test('loads and is functional', function (done) {
if (platform.isLinux) { if (platform.isLinux) {
// Skip test due to set up issue with Travis. // Skip test due to set up issue with Travis.
this.skip();
return; return;
} }
(async () => { (async () => {
......
...@@ -165,7 +165,6 @@ suite('EditorSimpleWorker', () => { ...@@ -165,7 +165,6 @@ suite('EditorSimpleWorker', () => {
return worker.textualSuggest([model.uri.toString()], 'f', '[a-z]+', 'img').then((result) => { return worker.textualSuggest([model.uri.toString()], 'f', '[a-z]+', 'img').then((result) => {
if (!result) { if (!result) {
assert.ok(false); assert.ok(false);
return;
} }
assert.equal(result.words.length, 1); assert.equal(result.words.length, 1);
assert.equal(typeof result.duration, 'number'); assert.equal(typeof result.duration, 'number');
......
...@@ -391,7 +391,6 @@ suite('SplitLinesCollection', () => { ...@@ -391,7 +391,6 @@ suite('SplitLinesCollection', () => {
} }
if (expected === null) { if (expected === null) {
assert.ok(false); assert.ok(false);
return;
} }
assert.equal(actual.content, expected.content); assert.equal(actual.content, expected.content);
assert.equal(actual.minColumn, expected.minColumn); assert.equal(actual.minColumn, expected.minColumn);
......
...@@ -87,7 +87,7 @@ suite('Files - TextFileEditor', () => { ...@@ -87,7 +87,7 @@ suite('Files - TextFileEditor', () => {
return viewStateTest(this, false); return viewStateTest(this, false);
}); });
async function viewStateTest(context: Mocha.ITestCallbackContext, restoreViewState: boolean): Promise<void> { async function viewStateTest(context: Mocha.Context, restoreViewState: boolean): Promise<void> {
const [part, accessor] = await createPart(restoreViewState); const [part, accessor] = await createPart(restoreViewState);
let editor = await accessor.editorService.openEditor(accessor.editorService.createEditorInput({ resource: toResource.call(context, '/path/index.txt'), forceFile: true })); let editor = await accessor.editorService.openEditor(accessor.editorService.createEditorInput({ resource: toResource.call(context, '/path/index.txt'), forceFile: true }));
......
...@@ -397,7 +397,7 @@ function tlsPatches(originals: typeof tls) { ...@@ -397,7 +397,7 @@ function tlsPatches(originals: typeof tls) {
}; };
function patch(original: typeof tls.createSecureContext): typeof tls.createSecureContext { function patch(original: typeof tls.createSecureContext): typeof tls.createSecureContext {
return function (details: tls.SecureContextOptions): ReturnType<typeof tls.createSecureContext> { return function (details?: tls.SecureContextOptions): ReturnType<typeof tls.createSecureContext> {
const context = original.apply(null, arguments as any); const context = original.apply(null, arguments as any);
const certs = (details as any)._vscodeAdditionalCaCerts; const certs = (details as any)._vscodeAdditionalCaCerts;
if (certs) { if (certs) {
......
...@@ -182,7 +182,7 @@ suite('Files - TextFileEditorModel', () => { ...@@ -182,7 +182,7 @@ suite('Files - TextFileEditorModel', () => {
await model.save({ force: true }); await model.save({ force: true });
assert.ok(savedEvent); assert.ok(savedEvent);
assert.ok(!model.isDirty()); assert.strictEqual(model.isDirty(), false);
model.dispose(); model.dispose();
assert.ok(!accessor.modelService.getModel(model.resource)); assert.ok(!accessor.modelService.getModel(model.resource));
...@@ -373,7 +373,7 @@ suite('Files - TextFileEditorModel', () => { ...@@ -373,7 +373,7 @@ suite('Files - TextFileEditorModel', () => {
assert.equal(accessor.workingCopyService.isDirty(model.resource), true); assert.equal(accessor.workingCopyService.isDirty(model.resource), true);
await model.revert(); await model.revert();
assert.ok(!model.isDirty()); assert.strictEqual(model.isDirty(), false);
assert.equal(model.textEditorModel!.getValue(), 'Hello Html'); assert.equal(model.textEditorModel!.getValue(), 'Hello Html');
assert.equal(eventCounter, 1); assert.equal(eventCounter, 1);
...@@ -406,7 +406,7 @@ suite('Files - TextFileEditorModel', () => { ...@@ -406,7 +406,7 @@ suite('Files - TextFileEditorModel', () => {
assert.equal(accessor.workingCopyService.isDirty(model.resource), true); assert.equal(accessor.workingCopyService.isDirty(model.resource), true);
await model.revert({ soft: true }); await model.revert({ soft: true });
assert.ok(!model.isDirty()); assert.strictEqual(model.isDirty(), false);
assert.equal(model.textEditorModel!.getValue(), 'foo'); assert.equal(model.textEditorModel!.getValue(), 'foo');
assert.equal(eventCounter, 1); assert.equal(eventCounter, 1);
...@@ -453,7 +453,7 @@ suite('Files - TextFileEditorModel', () => { ...@@ -453,7 +453,7 @@ suite('Files - TextFileEditorModel', () => {
assert.ok(model.isDirty()); assert.ok(model.isDirty());
await model.revert({ soft: true }); await model.revert({ soft: true });
assert.ok(!model.isDirty()); assert.strictEqual(model.isDirty(), false);
model.onDidChangeDirty(() => eventCounter++); model.onDidChangeDirty(() => eventCounter++);
...@@ -470,7 +470,7 @@ suite('Files - TextFileEditorModel', () => { ...@@ -470,7 +470,7 @@ suite('Files - TextFileEditorModel', () => {
assert.ok(workingCopyEvent); assert.ok(workingCopyEvent);
model.setDirty(false); model.setDirty(false);
assert.ok(!model.isDirty()); assert.strictEqual(model.isDirty(), false);
assert.equal(eventCounter, 2); assert.equal(eventCounter, 2);
model.dispose(); model.dispose();
......
...@@ -200,7 +200,7 @@ suite('ExtHostLanguageFeatureCommands', function () { ...@@ -200,7 +200,7 @@ suite('ExtHostLanguageFeatureCommands', function () {
return commands.executeCommand<vscode.SymbolInformation[]>('vscode.executeWorkspaceSymbolProvider', 'testing').then(value => { return commands.executeCommand<vscode.SymbolInformation[]>('vscode.executeWorkspaceSymbolProvider', 'testing').then(value => {
for (let info of value) { for (let info of value) {
assert.ok(info instanceof types.SymbolInformation); assert.strictEqual(info instanceof types.SymbolInformation, true);
assert.equal(info.name, 'testing'); assert.equal(info.name, 'testing');
assert.equal(info.kind, types.SymbolKind.Array); assert.equal(info.kind, types.SymbolKind.Array);
} }
...@@ -566,8 +566,8 @@ suite('ExtHostLanguageFeatureCommands', function () { ...@@ -566,8 +566,8 @@ suite('ExtHostLanguageFeatureCommands', function () {
return commands.executeCommand<vscode.SymbolInformation[]>('vscode.executeDocumentSymbolProvider', model.uri).then(values => { return commands.executeCommand<vscode.SymbolInformation[]>('vscode.executeDocumentSymbolProvider', model.uri).then(values => {
assert.equal(values.length, 2); assert.equal(values.length, 2);
let [first, second] = values; let [first, second] = values;
assert.ok(first instanceof types.SymbolInformation); assert.strictEqual(first instanceof types.SymbolInformation, true);
assert.ok(second instanceof types.SymbolInformation); assert.strictEqual(second instanceof types.SymbolInformation, true);
assert.equal(first.name, 'testing2'); assert.equal(first.name, 'testing2');
assert.equal(second.name, 'testing1'); assert.equal(second.name, 'testing1');
}); });
...@@ -594,9 +594,9 @@ suite('ExtHostLanguageFeatureCommands', function () { ...@@ -594,9 +594,9 @@ suite('ExtHostLanguageFeatureCommands', function () {
return commands.executeCommand<(vscode.SymbolInformation & vscode.DocumentSymbol)[]>('vscode.executeDocumentSymbolProvider', model.uri).then(values => { return commands.executeCommand<(vscode.SymbolInformation & vscode.DocumentSymbol)[]>('vscode.executeDocumentSymbolProvider', model.uri).then(values => {
assert.equal(values.length, 2); assert.equal(values.length, 2);
let [first, second] = values; let [first, second] = values;
assert.ok(first instanceof types.SymbolInformation); assert.strictEqual(first instanceof types.SymbolInformation, true);
assert.ok(!(first instanceof types.DocumentSymbol)); assert.strictEqual(first instanceof types.DocumentSymbol, false);
assert.ok(second instanceof types.SymbolInformation); assert.strictEqual(second instanceof types.SymbolInformation, true);
assert.equal(first.name, 'DocumentSymbol'); assert.equal(first.name, 'DocumentSymbol');
assert.equal(first.children.length, 1); assert.equal(first.children.length, 1);
assert.equal(second.name, 'SymbolInformation'); assert.equal(second.name, 'SymbolInformation');
......
...@@ -107,7 +107,7 @@ suite('Workbench EditorPane', () => { ...@@ -107,7 +107,7 @@ suite('Workbench EditorPane', () => {
assert(!e.input); assert(!e.input);
await e.setInput(input, options, Object.create(null), CancellationToken.None); await e.setInput(input, options, Object.create(null), CancellationToken.None);
assert.strictEqual(input, e.input); assert.strictEqual(<any>input, e.input);
const group = new TestEditorGroupView(1); const group = new TestEditorGroupView(1);
e.setVisible(true, group); e.setVisible(true, group);
assert(e.isVisible()); assert(e.isVisible());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册