diff --git a/test/fixtures/experimental/export-extensions/default-and-ns/actual.js b/test/fixtures/experimental/export-extensions/default-and-ns/actual.js new file mode 100644 index 0000000000..01fa3e806a --- /dev/null +++ b/test/fixtures/experimental/export-extensions/default-and-ns/actual.js @@ -0,0 +1 @@ +export B, * as A from 'test'; diff --git a/test/fixtures/experimental/export-extensions/default-and-ns/expected.json b/test/fixtures/experimental/export-extensions/default-and-ns/expected.json new file mode 100644 index 0000000000..5880077cce --- /dev/null +++ b/test/fixtures/experimental/export-extensions/default-and-ns/expected.json @@ -0,0 +1,135 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "specifiers": [ + { + "type": "ExportDefaultSpecifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "exported": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "B" + }, + "name": "B" + } + }, + { + "type": "ExportNamespaceSpecifier", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "exported": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "A" + }, + "name": "A" + } + } + ], + "source": { + "type": "StringLiteral", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "extra": { + "rawValue": "test", + "raw": "'test'" + }, + "value": "test" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/export-extensions/default/actual.js b/test/fixtures/experimental/export-extensions/default/actual.js new file mode 100644 index 0000000000..8493ca5743 --- /dev/null +++ b/test/fixtures/experimental/export-extensions/default/actual.js @@ -0,0 +1 @@ +export A from 'test'; diff --git a/test/fixtures/experimental/export-extensions/default/expected.json b/test/fixtures/experimental/export-extensions/default/expected.json new file mode 100644 index 0000000000..850834e228 --- /dev/null +++ b/test/fixtures/experimental/export-extensions/default/expected.json @@ -0,0 +1,103 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [ + { + "type": "ExportDefaultSpecifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "exported": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "A" + }, + "name": "A" + } + } + ], + "source": { + "type": "StringLiteral", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "test", + "raw": "'test'" + }, + "value": "test" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/export-extensions/ns/actual.js b/test/fixtures/experimental/export-extensions/ns/actual.js new file mode 100644 index 0000000000..27357f4758 --- /dev/null +++ b/test/fixtures/experimental/export-extensions/ns/actual.js @@ -0,0 +1 @@ +export * as A from 'test'; diff --git a/test/fixtures/experimental/export-extensions/ns/expected.json b/test/fixtures/experimental/export-extensions/ns/expected.json new file mode 100644 index 0000000000..b1affb10e9 --- /dev/null +++ b/test/fixtures/experimental/export-extensions/ns/expected.json @@ -0,0 +1,103 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "specifiers": [ + { + "type": "ExportNamespaceSpecifier", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "exported": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "A" + }, + "name": "A" + } + } + ], + "source": { + "type": "StringLiteral", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": "test", + "raw": "'test'" + }, + "value": "test" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/export-extensions/options.json b/test/fixtures/experimental/export-extensions/options.json new file mode 100644 index 0000000000..15b0cf1ea2 --- /dev/null +++ b/test/fixtures/experimental/export-extensions/options.json @@ -0,0 +1,4 @@ +{ + "plugins": ["exportExtensions"], + "sourceType": "module" +}