Permalink
Browse files

feat(es2017): support trailing comma

  • Loading branch information...
h13i32maru committed Sep 25, 2016
1 parent df2d6c7 commit dc9ba0fd904adbc1519f27c15fab104f1a4414a5
@@ -0,0 +1,18 @@
/**
* this is TestTrailingCommaDefinition.
*/
export default class TestTrailingCommaDefinition {
/**
* this is method1.
* @param {number} p1 - this is p1.
* @param {string} p2 - this is p2.
*/
method1(p1, p2,) {}
/**
* this is method2.
*/
method2(){
this.method1(1, 'abc',);
}
}
@@ -9,8 +9,8 @@ describe('test coverage', ()=> {
it('has coverage summary', ()=> {
assert(badge.includes('79%'));
assert.includes(doc, '[data-ice="coverageBadge"]', './badge.svg', 'src');
assert.includes(doc, '[data-ice="totalCoverageCount"]', '260/327');
assert.equal(doc.find('[data-ice="file"] [data-ice="coverage"]').length, 115);
assert.includes(doc, '[data-ice="totalCoverageCount"]', '263/330');
assert.equal(doc.find('[data-ice="file"] [data-ice="coverage"]').length, 116);
});
/* eslint-disable max-statements */
@@ -114,6 +114,7 @@ describe('test coverage', ()=> {
test('file/src/Todo/Class.js.html', '100 %4/4');
test('file/src/Todo/Function.js.html', '100 %1/1');
test('file/src/Todo/Variable.js.html', '100 %1/1');
test('file/src/TrailingComma/Definition.js.html', '100 %3/3');
test('file/src/Type/Array.js.html', '100 %2/2');
test('file/src/Type/Class.js.html#errorLines=1,9', '33 %1/3');
test('file/src/Type/Complex.js.html#errorLines=1', '80 %4/5');
@@ -139,6 +140,6 @@ describe('test coverage', ()=> {
test('file/src/Version/Function.js.html', '100 %1/1');
test('file/src/Version/Variable.js.html', '100 %1/1');
assert.equal(count, 115);
assert.equal(count, 116);
});
});
@@ -0,0 +1,37 @@
import {readDoc, assert, findParent} from './../../../util.js';
/** @test {ESParser} */
describe('TestTrailingCommaDefinition', ()=> {
const doc = readDoc('class/src/TrailingComma/Definition.js~TestTrailingCommaDefinition.html');
describe('in self detail', ()=> {
it('has desc.', ()=> {
assert.includes(doc, '.self-detail [data-ice="description"]', 'this is TestTrailingCommaDefinition.');
});
});
describe('in summary', ()=> {
it('has desc', ()=> {
findParent(doc, '[data-ice="summary"] [href$="#instance-method-method1"]', '[data-ice="target"]', (doc)=> {
assert.includes(doc, null, 'public method1(p1: number, p2: string)');
});
findParent(doc, '[data-ice="summary"] [href$="#instance-method-method2"]', '[data-ice="target"]', (doc)=> {
assert.includes(doc, null, 'public method2()');
});
});
});
describe('in details', ()=>{
it('has desc.', ()=>{
findParent(doc, '[id="instance-method-method1"]', '[data-ice="detail"]', (doc)=>{
assert.includes(doc, '.params [data-ice="property"]:nth-of-type(1)', 'p1 number this is p1.');
assert.includes(doc, '.params [data-ice="property"]:nth-of-type(2)', 'p2 string this is p2.');
});
findParent(doc, '[id="instance-method-method2"]', '[data-ice="detail"]', (doc)=>{
assert.includes(doc, '[data-ice="description"]', 'this is method2.');
});
});
});
});

0 comments on commit dc9ba0f

Please sign in to comment.