Skip to content

Commit

Permalink
Add full support for Diagnostic.code
Browse files Browse the repository at this point in the history
Updated the framework to have full support according to the VS Code API
  • Loading branch information
Estelle Foisy committed Oct 13, 2022
1 parent 5760804 commit c047833
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions packages/plugin-ext/src/plugin/type-converters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { MarkdownString } from './markdown-string';
import { MarkdownString as MarkdownStringInterface } from '@theia/core/lib/common/markdown-rendering';
import { TaskDto } from '../common/plugin-api-rpc';
import { TaskGroup } from './types-impl';
import { expect } from 'chai';

describe('Type converters:', () => {

Expand Down Expand Up @@ -439,23 +438,23 @@ describe('Type converters:', () => {
});
});

describe.only('#convertCode', () => {
it('should return "true" if convertCode(string) is of string type (string)', () => {
expect(Converter.convertCode('string')).to.equal('string');
describe('#convertCode', () => {
it('should convert a "code" of type "string"', () => {
assert.strictEqual(Converter.convertCode('string'), 'string');
});
it('should return "true" if convertCode(4) of string type (4)', () => {
expect(Converter.convertCode(4)).to.equal('4');
it('should convert a "code" of type "number"', () => {
assert.strictEqual(Converter.convertCode(4), '4');
});
it('should return "true" if convertCode is undefined', () => {
expect(Converter.convertCode(undefined)).to.equal(undefined);
it('should convert an undefined "code"', () => {
assert.strictEqual(Converter.convertCode(undefined), undefined);
});
it('should return "true" if convertcode(object) is of string type (4)', () => {
const UriCode = types.URI.parse('foo://example.com:8042/over/there?name=ferret#nose');
expect(Converter.convertCode({ value: 4, target: UriCode })).to.equal('4');
it('should convert a "code" of type "{ value: number, target: Uri }"', () => {
const Uri = types.URI.parse('foo://example.com:8042/over/there?name=ferret#nose');
assert.strictEqual(Converter.convertCode({ value: 4, target: Uri }), '4');
});
it('should return "true" if convertcode(object) is of string type (string)', () => {
const UriCode = types.URI.parse('foo://example.com:8042/over/there?name=ferret#nose');
expect(Converter.convertCode({ value: 'string', target: UriCode })).to.equal('string');
it('should convert a "code" of type "{ value: number, target: Uri }"', () => {
const Uri = types.URI.parse('foo://example.com:8042/over/there?name=ferret#nose');
assert.strictEqual(Converter.convertCode({ value: 'string', target: Uri }), 'string');
});
});
});

0 comments on commit c047833

Please sign in to comment.