Adopt new mocha types
This commit is contained in:
parent
f74ad9692f
commit
edd37076b4
16 changed files with 25 additions and 33 deletions
|
@ -1272,8 +1272,7 @@ suite('regression', () => {
|
|||
assert.strictEqual(vscode.window.activeNotebookEditor!.document.uri.toString(), resource.toString());
|
||||
});
|
||||
|
||||
test('Cannot open notebook from cell-uri with vscode.open-command', async function () {
|
||||
this.skip();
|
||||
test.skip('Cannot open notebook from cell-uri with vscode.open-command', async function () {
|
||||
assertInitalState();
|
||||
const resource = await createRandomFile('', undefined, 'first', '.vsctestnb');
|
||||
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
|
||||
|
|
|
@ -576,12 +576,12 @@ suite('Async', () => {
|
|||
sequentializer.setPending(2, async.timeout(1));
|
||||
assert.ok(sequentializer.hasPending());
|
||||
assert.ok(sequentializer.hasPending(2));
|
||||
assert.ok(!sequentializer.hasPending(1));
|
||||
assert.strictEqual(sequentializer.hasPending(1), false);
|
||||
assert.ok(sequentializer.pending);
|
||||
|
||||
await async.timeout(2);
|
||||
assert.ok(!sequentializer.hasPending());
|
||||
assert.ok(!sequentializer.hasPending(2));
|
||||
assert.strictEqual(sequentializer.hasPending(), false);
|
||||
assert.strictEqual(sequentializer.hasPending(2), false);
|
||||
assert.ok(!sequentializer.pending);
|
||||
});
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ const patterns = ['cci', 'ida', 'pos', 'CCI', 'enbled', 'callback', 'gGame', 'co
|
|||
|
||||
const _enablePerf = false;
|
||||
|
||||
function perfSuite(name: string, callback: (this: Mocha.ISuiteCallbackContext) => void) {
|
||||
function perfSuite(name: string, callback: (this: Mocha.Suite) => void) {
|
||||
if (_enablePerf) {
|
||||
suite(name, callback);
|
||||
}
|
||||
|
|
|
@ -101,7 +101,6 @@ suite('PagedModel', () => {
|
|||
test('preemptive cancellation works', async function () {
|
||||
const pager = new TestPager(() => {
|
||||
assert(false);
|
||||
return Promise.resolve([]);
|
||||
});
|
||||
|
||||
const model = new PagedModel(pager);
|
||||
|
|
|
@ -141,8 +141,7 @@ suite('SkipList', function () {
|
|||
}
|
||||
|
||||
|
||||
test('perf', function () {
|
||||
this.skip();
|
||||
test.skip('perf', function () {
|
||||
|
||||
// data
|
||||
const max = 2 ** 16;
|
||||
|
|
|
@ -57,7 +57,7 @@ suite('Types', () => {
|
|||
assert(!types.isObject(/test/));
|
||||
assert(!types.isObject(new RegExp('')));
|
||||
assert(!types.isFunction(new Date()));
|
||||
assert(!types.isObject(assert));
|
||||
assert.strictEqual(types.isObject(assert), false);
|
||||
assert(!types.isObject(function foo() { }));
|
||||
|
||||
assert(types.isObject({}));
|
||||
|
@ -75,7 +75,7 @@ suite('Types', () => {
|
|||
assert(!types.isEmptyObject(/test/));
|
||||
assert(!types.isEmptyObject(new RegExp('')));
|
||||
assert(!types.isEmptyObject(new Date()));
|
||||
assert(!types.isEmptyObject(assert));
|
||||
assert.strictEqual(types.isEmptyObject(assert), false);
|
||||
assert(!types.isEmptyObject(function foo() { /**/ }));
|
||||
assert(!types.isEmptyObject({ foo: 'bar' }));
|
||||
|
||||
|
|
|
@ -444,8 +444,7 @@ suite('URI', () => {
|
|||
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 () {
|
||||
this.skip();
|
||||
test.skip('Links in markdown are broken if url contains encoded parameters #79474', function () {
|
||||
let strIn = 'https://myhost.com/Redirect?url=http%3A%2F%2Fwww.bing.com%3Fsearch%3Dtom';
|
||||
let uri1 = URI.parse(strIn);
|
||||
let strOut = uri1.toString();
|
||||
|
@ -459,8 +458,7 @@ suite('URI', () => {
|
|||
assert.equal(strIn, strOut); // fails here!!
|
||||
});
|
||||
|
||||
test('Uri#parse can break path-component #45515', function () {
|
||||
this.skip();
|
||||
test.skip('Uri#parse can break path-component #45515', function () {
|
||||
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 strOut = uri1.toString();
|
||||
|
|
|
@ -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++) {
|
||||
test(`${description} (iteration ${i})`, callback);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ suite('Keytar', () => {
|
|||
test('loads and is functional', function (done) {
|
||||
if (platform.isLinux) {
|
||||
// Skip test due to set up issue with Travis.
|
||||
this.skip();
|
||||
return;
|
||||
}
|
||||
(async () => {
|
||||
|
|
|
@ -165,7 +165,6 @@ suite('EditorSimpleWorker', () => {
|
|||
return worker.textualSuggest([model.uri.toString()], 'f', '[a-z]+', 'img').then((result) => {
|
||||
if (!result) {
|
||||
assert.ok(false);
|
||||
return;
|
||||
}
|
||||
assert.equal(result.words.length, 1);
|
||||
assert.equal(typeof result.duration, 'number');
|
||||
|
|
|
@ -391,7 +391,6 @@ suite('SplitLinesCollection', () => {
|
|||
}
|
||||
if (expected === null) {
|
||||
assert.ok(false);
|
||||
return;
|
||||
}
|
||||
assert.equal(actual.content, expected.content);
|
||||
assert.equal(actual.minColumn, expected.minColumn);
|
||||
|
|
|
@ -87,7 +87,7 @@ suite('Files - TextFileEditor', () => {
|
|||
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);
|
||||
|
||||
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) {
|
|||
};
|
||||
|
||||
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 certs = (details as any)._vscodeAdditionalCaCerts;
|
||||
if (certs) {
|
||||
|
|
|
@ -182,7 +182,7 @@ suite('Files - TextFileEditorModel', () => {
|
|||
await model.save({ force: true });
|
||||
|
||||
assert.ok(savedEvent);
|
||||
assert.ok(!model.isDirty());
|
||||
assert.strictEqual(model.isDirty(), false);
|
||||
|
||||
model.dispose();
|
||||
assert.ok(!accessor.modelService.getModel(model.resource));
|
||||
|
@ -373,7 +373,7 @@ suite('Files - TextFileEditorModel', () => {
|
|||
assert.equal(accessor.workingCopyService.isDirty(model.resource), true);
|
||||
|
||||
await model.revert();
|
||||
assert.ok(!model.isDirty());
|
||||
assert.strictEqual(model.isDirty(), false);
|
||||
assert.equal(model.textEditorModel!.getValue(), 'Hello Html');
|
||||
assert.equal(eventCounter, 1);
|
||||
|
||||
|
@ -406,7 +406,7 @@ suite('Files - TextFileEditorModel', () => {
|
|||
assert.equal(accessor.workingCopyService.isDirty(model.resource), true);
|
||||
|
||||
await model.revert({ soft: true });
|
||||
assert.ok(!model.isDirty());
|
||||
assert.strictEqual(model.isDirty(), false);
|
||||
assert.equal(model.textEditorModel!.getValue(), 'foo');
|
||||
assert.equal(eventCounter, 1);
|
||||
|
||||
|
@ -453,7 +453,7 @@ suite('Files - TextFileEditorModel', () => {
|
|||
assert.ok(model.isDirty());
|
||||
|
||||
await model.revert({ soft: true });
|
||||
assert.ok(!model.isDirty());
|
||||
assert.strictEqual(model.isDirty(), false);
|
||||
|
||||
model.onDidChangeDirty(() => eventCounter++);
|
||||
|
||||
|
@ -470,7 +470,7 @@ suite('Files - TextFileEditorModel', () => {
|
|||
assert.ok(workingCopyEvent);
|
||||
|
||||
model.setDirty(false);
|
||||
assert.ok(!model.isDirty());
|
||||
assert.strictEqual(model.isDirty(), false);
|
||||
assert.equal(eventCounter, 2);
|
||||
|
||||
model.dispose();
|
||||
|
|
|
@ -200,7 +200,7 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
|||
return commands.executeCommand<vscode.SymbolInformation[]>('vscode.executeWorkspaceSymbolProvider', 'testing').then(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.kind, types.SymbolKind.Array);
|
||||
}
|
||||
|
@ -566,8 +566,8 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
|||
return commands.executeCommand<vscode.SymbolInformation[]>('vscode.executeDocumentSymbolProvider', model.uri).then(values => {
|
||||
assert.equal(values.length, 2);
|
||||
let [first, second] = values;
|
||||
assert.ok(first instanceof types.SymbolInformation);
|
||||
assert.ok(second instanceof types.SymbolInformation);
|
||||
assert.strictEqual(first instanceof types.SymbolInformation, true);
|
||||
assert.strictEqual(second instanceof types.SymbolInformation, true);
|
||||
assert.equal(first.name, 'testing2');
|
||||
assert.equal(second.name, 'testing1');
|
||||
});
|
||||
|
@ -594,9 +594,9 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
|||
return commands.executeCommand<(vscode.SymbolInformation & vscode.DocumentSymbol)[]>('vscode.executeDocumentSymbolProvider', model.uri).then(values => {
|
||||
assert.equal(values.length, 2);
|
||||
let [first, second] = values;
|
||||
assert.ok(first instanceof types.SymbolInformation);
|
||||
assert.ok(!(first instanceof types.DocumentSymbol));
|
||||
assert.ok(second instanceof types.SymbolInformation);
|
||||
assert.strictEqual(first instanceof types.SymbolInformation, true);
|
||||
assert.strictEqual(first instanceof types.DocumentSymbol, false);
|
||||
assert.strictEqual(second instanceof types.SymbolInformation, true);
|
||||
assert.equal(first.name, 'DocumentSymbol');
|
||||
assert.equal(first.children.length, 1);
|
||||
assert.equal(second.name, 'SymbolInformation');
|
||||
|
|
|
@ -107,7 +107,7 @@ suite('Workbench EditorPane', () => {
|
|||
assert(!e.input);
|
||||
|
||||
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);
|
||||
e.setVisible(true, group);
|
||||
assert(e.isVisible());
|
||||
|
|
Loading…
Reference in a new issue