|
| 1 | +// Jest Snapshot v1, https://goo.gl/fbAQLP |
| 2 | + |
| 3 | +exports[`case JavaScript output: transformed source code 1`] = ` |
| 4 | +"const n = 0; |
| 5 | +
|
| 6 | +module.exports = |
| 7 | + n === 1 ? ( |
| 8 | + <p key=\\"pug:0:0\\">One</p> |
| 9 | + ) : n === 2 ? ( |
| 10 | + <p key=\\"pug:1:0\\">Two</p> |
| 11 | + ) : null; |
| 12 | +" |
| 13 | +`; |
| 14 | +
|
| 15 | +exports[`case html output: generated html 1`] = `null`; |
| 16 | +
|
| 17 | +exports[`case static html output: static html 1`] = `""`; |
| 18 | +
|
| 19 | +exports[`code JavaScript output: transformed source code 1`] = ` |
| 20 | +"const log = text => text; |
| 21 | +
|
| 22 | +module.exports = (log(\\"Hello\\"), null); |
| 23 | +" |
| 24 | +`; |
| 25 | +
|
| 26 | +exports[`code html output: generated html 1`] = `null`; |
| 27 | +
|
| 28 | +exports[`code static html output: static html 1`] = `""`; |
| 29 | +
|
| 30 | +exports[`code-multiline JavaScript output: transformed source code 1`] = ` |
| 31 | +"let _greeting; |
| 32 | +
|
| 33 | +const log = text => text; |
| 34 | +
|
| 35 | +module.exports = ( |
| 36 | + <React.Fragment> |
| 37 | + {((_greeting = \\"hello\\"), null)} |
| 38 | + {(log(_greeting), null)} |
| 39 | + </React.Fragment> |
| 40 | +); |
| 41 | +" |
| 42 | +`; |
| 43 | +
|
| 44 | +exports[`code-multiline html output: generated html 1`] = `null`; |
| 45 | +
|
| 46 | +exports[`code-multiline static html output: static html 1`] = `""`; |
| 47 | +
|
| 48 | +exports[`each JavaScript output: transformed source code 1`] = ` |
| 49 | +"module.exports = ((_pug_nodes, _pug_arr) => { |
| 50 | + if (!(_pug_arr == null || Array.isArray(_pug_arr))) |
| 51 | + throw new Error( |
| 52 | + 'Expected \\"[1, 2, 3]\\" to be an array because it is passed to each.' |
| 53 | + ); |
| 54 | + if (_pug_arr == null || _pug_arr.length === 0) return undefined; |
| 55 | +
|
| 56 | + for (let _pug_index = 0; _pug_index < _pug_arr.length; _pug_index++) { |
| 57 | + const item = _pug_arr[_pug_index]; |
| 58 | + _pug_nodes[_pug_nodes.length] = <div key={\\"pug\\" + item + \\":0\\"}>{item}</div>; |
| 59 | + } |
| 60 | +
|
| 61 | + return _pug_nodes; |
| 62 | +})([], [1, 2, 3]); |
| 63 | +" |
| 64 | +`; |
| 65 | +
|
| 66 | +exports[`each html output: generated html 1`] = ` |
| 67 | +Array [ |
| 68 | + <div> |
| 69 | + 1 |
| 70 | + </div>, |
| 71 | + <div> |
| 72 | + 2 |
| 73 | + </div>, |
| 74 | + <div> |
| 75 | + 3 |
| 76 | + </div>, |
| 77 | +] |
| 78 | +`; |
| 79 | +
|
| 80 | +exports[`each static html output: static html 1`] = `"<div>1</div><div>2</div><div>3</div>"`; |
| 81 | +
|
| 82 | +exports[`if JavaScript output: transformed source code 1`] = ` |
| 83 | +"module.exports = false ? <p key=\\"pug:0:0\\">Truthy</p> : null; |
| 84 | +" |
| 85 | +`; |
| 86 | +
|
| 87 | +exports[`if html output: generated html 1`] = `null`; |
| 88 | +
|
| 89 | +exports[`if static html output: static html 1`] = `""`; |
| 90 | +
|
| 91 | +exports[`while JavaScript output: transformed source code 1`] = ` |
| 92 | +"let n = 0; |
| 93 | +
|
| 94 | +module.exports = (_pug_nodes => { |
| 95 | + while (n < 3) { |
| 96 | + _pug_nodes[_pug_nodes.length] = <div key={n}>{n++}</div>; |
| 97 | + } |
| 98 | +
|
| 99 | + return _pug_nodes; |
| 100 | +})([]); |
| 101 | +" |
| 102 | +`; |
| 103 | +
|
| 104 | +exports[`while html output: generated html 1`] = ` |
| 105 | +Array [ |
| 106 | + <div> |
| 107 | + 0 |
| 108 | + </div>, |
| 109 | + <div> |
| 110 | + 1 |
| 111 | + </div>, |
| 112 | + <div> |
| 113 | + 2 |
| 114 | + </div>, |
| 115 | +] |
| 116 | +`; |
| 117 | +
|
| 118 | +exports[`while static html output: static html 1`] = `"<div>0</div><div>1</div><div>2</div>"`; |
0 commit comments