remove es20xx prefixes from plugins and rename folders (#6575)
This commit is contained in:
36
packages/babel-plugin-transform-modules-commonjs/test/fixtures/source-map/exec.js
vendored
Normal file
36
packages/babel-plugin-transform-modules-commonjs/test/fixtures/source-map/exec.js
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
var tests = [
|
||||
'import "foo";',
|
||||
'import foo from "foo";',
|
||||
'import {default as foo2} from "foo";',
|
||||
'import * as foo from "foo";',
|
||||
'import {bar} from "foo";',
|
||||
'import {bar2, baz} from "foo";',
|
||||
'import {bar as baz2} from "foo";',
|
||||
'import {bar as baz3, xyz} from "foo";',
|
||||
'import bar, * as bar2 from "foo";',
|
||||
'import bar, {bar2, bar3 as bar4} from "foo";',
|
||||
|
||||
'export var a;',
|
||||
'export default function(){};',
|
||||
'export default function f(){};',
|
||||
'export default 42;',
|
||||
'export {foo}; var foo;',
|
||||
'export { foo as default }; var foo;',
|
||||
'export * from "foo";',
|
||||
'export {foo} from "foo";',
|
||||
'export {default as foo} from "foo";',
|
||||
];
|
||||
|
||||
tests.forEach(function (code) {
|
||||
var res = transform(code, {
|
||||
sourceMap: true,
|
||||
plugins: opts.plugins
|
||||
});
|
||||
|
||||
// Should create mapping
|
||||
assert.notEqual(
|
||||
res.map.mappings,
|
||||
'',
|
||||
'expected to generate sourcemap for: ' + code
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user