11// Jest Snapshot v1, https://goo.gl/fbAQLP
22
3- exports [` JavaScript output: transformed source code 1` ] = `
3+ exports [` basic JavaScript output: transformed source code 1` ] = `
44"module.exports = (
55 <React.Fragment >
66 <div />
@@ -10,11 +10,98 @@ exports[`JavaScript output: transformed source code 1`] = `
1010"
1111` ;
1212
13- exports [` html output: generated html 1` ] = `
13+ exports [` basic html output: generated html 1` ] = `
1414Array [
1515 <div />,
1616 <div />,
1717]
1818` ;
1919
20- exports [` static html output: static html 1` ] = ` "<div ></div ><div ></div >"` ;
20+ exports [` basic static html output: static html 1` ] = ` "<div ></div ><div ></div >"` ;
21+
22+ exports [` with each JavaScript output: transformed source code 1` ] = `
23+ "module.exports = (
24+ <React.Fragment >
25+ { ((_pug_nodes , _pug_arr ) => {
26+ if (! (_pug_arr == null || Array .isArray (_pug_arr )))
27+ throw new Error (
28+ ' Expected \\ "[1, 2, 3]\\ " to be an array because it is passed to each.'
29+ );
30+ if (_pug_arr == null || _pug_arr .length === 0 ) return undefined ;
31+
32+ for (let _pug_index = 0 ; _pug_index < _pug_arr .length ; _pug_index ++ ) {
33+ const item = _pug_arr [_pug_index ];
34+ _pug_nodes [_pug_nodes .length ] = (
35+ <div key = { \\" pug\\ " + item + \\" :0\\ " } >{ item } </div >
36+ );
37+ }
38+
39+ return _pug_nodes ;
40+ })([], [1 , 2 , 3 ])}
41+ <div >Next item</div >
42+ </React.Fragment >
43+ );
44+ "
45+ ` ;
46+
47+ exports [` with each html output: generated html 1` ] = `
48+ Array [
49+ <div >
50+ 1
51+ </div >,
52+ <div >
53+ 2
54+ </div >,
55+ <div >
56+ 3
57+ </div >,
58+ <div >
59+ Next item
60+ </div >,
61+ ]
62+ ` ;
63+
64+ exports [` with each static html output: static html 1` ] = ` "<div >1</div ><div >2</div ><div >3</div ><div >Next item</div >"` ;
65+
66+ exports [` with if JavaScript output: transformed source code 1` ] = `
67+ "module.exports = (
68+ <React.Fragment >
69+ { true ? <div key =\\"pug:0:0\\">Truthy</div> : undefined}
70+ <div>Next item</div>
71+ </React.Fragment>
72+ );
73+ "
74+ `;
75+
76+ exports[`with if html output: generated html 1`] = `
77+ Array [
78+ <div>
79+ Truthy
80+ </div>,
81+ <div>
82+ Next item
83+ </div>,
84+ ]
85+ `;
86+
87+ exports[`with if static html output: static html 1`] = `" <div>Truthy</div><div>Next item</div>"`;
88+
89+ exports[`with inline javascript JavaScript output: transformed source code 1`] = `
90+ " let _i;
91+
92+ module.exports = (
93+ <React.Fragment>
94+ {((_i = 100), undefined)}
95+ <div>{_i}</div>
96+ </React.Fragment>
97+ );
98+ "
99+ `;
100+
101+ exports[`with inline javascript html output: generated html 1`] = `
102+ <div>
103+ 100
104+ </div>
105+ `;
106+
107+ exports[`with inline javascript static html output: static html 1`] = `"<div>100</div>"`;
0 commit comments