Skip to content

Commit

Permalink
test coverage for potential default export failure
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Apr 2, 2022
1 parent c9e2fdb commit ae23f41
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scripts/end-to-end-tests.js
Expand Up @@ -4784,6 +4784,30 @@
}
`,
}, { async: true }),
test(['in.js', '--outfile=node.js', '--keep-names', '--bundle'].concat(flags), {
// Check default export name preservation with lowered "super" inside lowered "async"
'in.js': `
import fn from './export'
if (fn.name !== 'default') throw 'fail: ' + fn.name
`,
'export.js': `
export default class extends Object {
async foo() { super.bar() }
}
`,
}),
test(['in.js', '--outfile=node.js', '--keep-names', '--bundle', '--minify'].concat(flags), {
// (minified) Check default export name preservation with lowered "super" inside lowered "async"
'in.js': `
import fn from './export'
if (fn.name !== 'default') throw 'fail: ' + fn.name
`,
'export.js': `
export default class extends Object {
async foo() { super.bar() }
}
`,
}),
test(['in.js', '--outfile=node.js'].concat(flags), {
// Test coverage for a TypeScript bug: https://github.com/microsoft/TypeScript/issues/46580
'in.js': `
Expand Down

0 comments on commit ae23f41

Please sign in to comment.