some cancellation error 💄

This commit is contained in:
Johannes
2022-03-28 13:52:31 +02:00
parent d80ed395ed
commit c2e314a9db
4 changed files with 17 additions and 8 deletions

View File

@@ -10,6 +10,7 @@ import { isWindows } from 'vs/base/common/platform';
import { assertType } from 'vs/base/common/types';
import { Mimes } from 'vs/base/common/mime';
import { MarshalledId } from 'vs/base/common/marshallingIds';
import { CancellationError } from 'vs/base/common/errors';
function assertToJSON(a: any, expected: any) {
const raw = JSON.stringify(a);
@@ -565,6 +566,14 @@ suite('ExtHostTypes', function () {
assert.ok(error instanceof types.FileSystemError);
});
test('CancellationError', function () {
// The CancellationError-type is used internally and exported as API. Make sure that at
// its name and message are `Canceled`
const err = new CancellationError();
assert.strictEqual(err.name, 'Canceled');
assert.strictEqual(err.message, 'Canceled');
});
test('CodeActionKind contains', () => {
assert.ok(types.CodeActionKind.RefactorExtract.contains(types.CodeActionKind.RefactorExtract));
assert.ok(types.CodeActionKind.RefactorExtract.contains(types.CodeActionKind.RefactorExtract.append('other')));