aboutsummaryrefslogtreecommitdiff
path: root/integration/snippets/jsx-spacing.jsx
blob: 73e31ebaa2d0450c1a9230eb7020af3cbfee43c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import * as ReactDOM from "react-dom/server";

const Tester = ({ description }) => {
  console.assert(
    description ===
      "foo\nbar \n\nbaz\n\nthis\ntest\n\nchecks\nnewlines\nare\ngood\nyeah\n\n",
    "Expected description to be 'foo\\nbar \\n\\nbaz\\n\\nthis\\ntest\\n\\nchecks\\nnewlines\\nare\\ngood\\nyeah\\n\\n' but was '" +
      description +
      "'"
  );

  return description;
};

export function test() {
  const foo = ReactDOM.renderToString(
    <Tester
      description="foo
  bar 
  
  baz
  
  this
  test
  
  checks
  newlines
  are
  good
  yeah
  
  "
    ></Tester>
  );
  testDone(import.meta.url);
}