bump coverage – duplicate default export is handled by acorn

pull/190/head
Rich-Harris 8 years ago
parent 4a610f7073
commit a35c516350

@ -16,10 +16,6 @@ export default function validateJs ( validator, js ) {
}
if ( node.type === 'ExportDefaultDeclaration' ) {
if ( validator.defaultExport ) {
return validator.error( `Duplicate default export`, node.start );
}
if ( node.declaration.type !== 'ObjectExpression' ) {
return validator.error( `Default export must be an object literal`, node.declaration.start );
}

@ -46,9 +46,9 @@ describe( 'validate', () => {
if ( err.name !== 'ParseError' ) throw err;
try {
const expected = require( `./validator/${dir}/error.json` );
const expected = require( `./validator/${dir}/errors.json` )[0];
assert.equal( err.shortMessage, expected.message );
assert.equal( err.message, expected.message );
assert.deepEqual( err.loc, expected.loc );
assert.equal( err.pos, expected.pos );
} catch ( err2 ) {

@ -0,0 +1,8 @@
[{
"message": "Duplicate export 'default'",
"pos": 37,
"loc": {
"line": 3,
"column": 8
}
}]

@ -0,0 +1,4 @@
<script>
export default {};
export default {};
</script>
Loading…
Cancel
Save