Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

Commit

Permalink
Workaround tsc bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfagnani committed Apr 25, 2017
1 parent ac7e20f commit 9f97e5b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/javascript/jsdoc.ts
Expand Up @@ -31,7 +31,7 @@ export function parseJsdoc(docs: string): doctrine.Annotation {
docs = removeLeadingAsterisks(docs);
const d = doctrine.parse(docs, {
unwrap: false,
lineNumbers: true,
// lineNumbers: true,
preserveWhitespace: true,
});
// Strip any leading and trailing newline characters in the
Expand Down
37 changes: 20 additions & 17 deletions src/test/javascript/jsdoc_test.ts
Expand Up @@ -15,6 +15,8 @@
import {assert} from 'chai';

import * as jsdoc from '../../javascript/jsdoc.js';
import {Privacy} from '../../model/model';
import * as doctrine from 'doctrine';

suite('jsdoc', () => {

Expand All @@ -41,7 +43,7 @@ suite('jsdoc', () => {
assert.deepEqual(parsed, {
description: '',
tags: [
{title: 'atag', description: null, lineNumber: 0},
{title: 'atag', description: null},
],
});
});
Expand All @@ -51,7 +53,7 @@ suite('jsdoc', () => {
assert.deepEqual(parsed, {
description: '',
tags: [
{title: 'do', description: 'stuff', lineNumber: 0},
{title: 'do', description: 'stuff'},
],
});
});
Expand All @@ -61,7 +63,7 @@ suite('jsdoc', () => {
assert.deepEqual(parsed, {
description: '',
tags: [
{title: 'do', description: 'a thing', lineNumber: 0},
{title: 'do', description: 'a thing'},
],
});
});
Expand All @@ -73,10 +75,9 @@ suite('jsdoc', () => {
tags: [
{
title: 'param',
type: {type: 'NameExpression', name: 'Type'},
type: {type: 'NameExpression', name: 'Type'} as doctrine.type.NameExpression,
name: 'name',
description: 'desc desc',
lineNumber: 0
},
],
});
Expand Down Expand Up @@ -112,20 +113,21 @@ suite('jsdoc', () => {
title: 'public',
description: '',
}]
}),
'public');
}),
// NOTE: This cast is necessary because of a crashing bug in tsc
'public' as Privacy);
});

test('returns protected for @protected', () => {
assert.equal(
jsdoc.getPrivacy({
description: '',
tags: [{
title: 'protected',
description: '',
}]
}),
'protected');
assert.equal(jsdoc.getPrivacy({
description: '',
tags: [{
title: 'protected',
description: null,
}],
}),
// NOTE: This cast is necessary because of a crashing bug in tsc
'protected' as Privacy);
});

test('returns private for @private', () => {
Expand All @@ -137,7 +139,8 @@ suite('jsdoc', () => {
description: '',
}]
}),
'private');
// NOTE: This cast is necessary because of a crashing bug in tsc
'private' as Privacy);
});

});
Expand Down

0 comments on commit 9f97e5b

Please sign in to comment.