11// Jest Snapshot v1, https://goo.gl/fbAQLP
22
3- exports [` correctly transpiles 1` ] = `
4- "import Foo from './bar'
3+ exports [` Handles an import that is later exported 1` ] = `
4+ Array [
5+ Object {
6+ " type" : " import" ,
7+ " value" : " import Layout from './Foo'
58
6- export { Baz } from './foo';
7- const makeShortcode = name => function MDXDefaultShortcode(props) {
8- console .warn (\\" Component \\ " + name + \\" was not imported, exported, or provided by MDXProvider as global scope\\ " )
9- return <div { ... props } />
10- } ;
11- const Paragraph = makeShortcode(\\ "Paragraph\\ ");
12- const Button = makeShortcode(\\ "Button\\ ");
13- const MDXLayout = Foo
14- export default function MDXContent({
15- components ,
16- ... props
17- } ) {
18- return <MDXLayout { ... props } components = { components } mdxType =\\"MDXLayout\\">
19- <h1>{\`Hello, world! \`}
20- <Foo bar = { {
21- baz: ' qux'
22- }} mdxType =\\"Foo\\" />< / h1 >
23- <Baz mdxType =\\"Baz\\">
24- <p>{\`Hi!\`}</p>
25- </Baz>
26- <Paragraph bg =\\"red.500\\" color =\\"white\\" mdxType =\\"Paragraph\\">
27- <p>{\`Foo\`}</p>
28- </Paragraph>
29- <Button mdxType =\\"Button\\">
30- <p>{\`Hi!\`}</p>
31- </Button>
32- <>
33- <p>{\`Foo\`}</p>
34- </>
35- <>
36- <p>{\`Foo\`}</p>
37- </>
38- <h1>
39- <p>{\`Hello, world!\`}</p>
40- </h1>
41- </MDXLayout>;
42- }
9+ " ,
10+ } ,
11+ Object {
12+ " default" : true ,
13+ " type" : " export" ,
14+ " value" : " export default Layout" ,
15+ } ,
16+ ]
17+ ` ;
4318
44- ;
45- MDXContent.isMDXComponent = true;"
19+ exports [` Handles basic usecase of default export 1` ] = `
20+ Array [
21+ Object {
22+ " default" : true ,
23+ " type" : " export" ,
24+ " value" : " export default props => <article {...props} />" ,
25+ } ,
26+ ]
27+ ` ;
28+
29+ exports [` Handles const exports 1` ] = `
30+ Array [
31+ Object {
32+ " type" : " export" ,
33+ " value" : " export const metadata = { some: \\ " stuff \\" }" ,
34+ } ,
35+ ]
36+ ` ;
37+
38+ exports [` Handles export all 1` ] = `
39+ Array [
40+ Object {
41+ " type" : " export" ,
42+ " value" : " export * from './foo'" ,
43+ } ,
44+ ]
45+ ` ;
46+
47+ exports [` Handles multiline default exports 1` ] = `
48+ Array [
49+ Object {
50+ " default" : true ,
51+ " type" : " export" ,
52+ " value" : " export default props => (
53+ <main { ... props } />
54+ )" ,
55+ } ,
56+ ]
57+ ` ;
58+
59+ exports [` Handles multiline exports 1` ] = `
60+ Array [
61+ Object {
62+ " type" : " export" ,
63+ " value" : " export const metadata = {
64+ some : \\" stuff\\ "
65+ } ",
66+ },
67+ ]
68+ ` ;
69+
70+ exports [` Separates import from the default export 1` ] = `
71+ Array [
72+ Object {
73+ " type" : " import" ,
74+ " value" : " import Foo from './foo'
75+ " ,
76+ } ,
77+ Object {
78+ " default" : true ,
79+ " type" : " export" ,
80+ " value" : " export default props => <article {...props} />" ,
81+ } ,
82+ ]
4683` ;
4784
48- exports[`maintains the proper positional info 1`] = `
85+ exports [` should maintain the proper positional info 1` ] = `
4986Object {
5087 " children" : Array [
5188 Object {
@@ -585,7 +622,7 @@ Object {
585622}
586623` ;
587624
588- exports[`removes newlines between imports and exports 1`] = `
625+ exports [` should remove newlines between imports and exports 1` ] = `
589626"import Foo1 from \\ "./foo\\ "
590627import Foo2 from \\ "./foo\\ "
591628import Foo3 from \\ "./foo\\ "
@@ -597,3 +634,48 @@ export default props => <article {...props} />
597634export const fred = \\ "flintstone\\ "
598635"
599636` ;
637+
638+ exports [` should transpile 1` ] = `
639+ "import Foo from './bar'
640+
641+ export { Baz } from './foo';
642+ const makeShortcode = name => function MDXDefaultShortcode(props) {
643+ console .warn (\\" Component \\ " + name + \\" was not imported, exported, or provided by MDXProvider as global scope\\ " )
644+ return <div { ... props } />
645+ } ;
646+ const Paragraph = makeShortcode(\\ "Paragraph\\ ");
647+ const Button = makeShortcode(\\ "Button\\ ");
648+ const MDXLayout = Foo
649+ export default function MDXContent({
650+ components ,
651+ ... props
652+ } ) {
653+ return <MDXLayout { ... props } components = { components } mdxType =\\"MDXLayout\\">
654+ <h1>{\`Hello, world! \`}
655+ <Foo bar = { {
656+ baz: ' qux'
657+ }} mdxType =\\"Foo\\" />< / h1 >
658+ <Baz mdxType =\\"Baz\\">
659+ <p>{\`Hi!\`}</p>
660+ </Baz>
661+ <Paragraph bg =\\"red.500\\" color =\\"white\\" mdxType =\\"Paragraph\\">
662+ <p>{\`Foo\`}</p>
663+ </Paragraph>
664+ <Button mdxType =\\"Button\\">
665+ <p>{\`Hi!\`}</p>
666+ </Button>
667+ <>
668+ <p>{\`Foo\`}</p>
669+ </>
670+ <>
671+ <p>{\`Foo\`}</p>
672+ </>
673+ <h1>
674+ <p>{\`Hello, world!\`}</p>
675+ </h1>
676+ </MDXLayout>;
677+ }
678+
679+ ;
680+ MDXContent.isMDXComponent = true;"
681+ `;
0 commit comments