Skip to content

Commit 77534bf

Browse files
committed
update snapshots
1 parent 863a5f7 commit 77534bf

File tree

3 files changed

+68
-35
lines changed

3 files changed

+68
-35
lines changed

test/snapshots/test.ts.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,36 @@ Generated by [AVA](https://avajs.dev).
7979
onClick: onPress␊
8080
}, "Press"));␊
8181
};`
82+
83+
## Multi Component Scope
84+
85+
> Snapshot 1
86+
87+
`import * as React from "react";␊
88+
let $b = 2;␊
89+
90+
const Component = () => {␊
91+
const [a, setA] = React.useState(1);␊
92+
93+
const onPress = () => {␊
94+
setA(a + 1);␊
95+
$b = 3;␊
96+
};␊
97+
98+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, a), /*#__PURE__*/React.createElement("button", {␊
99+
onClick: onPress␊
100+
}, "Press"));␊
101+
};␊
102+
103+
const ComponentTwo = () => {␊
104+
const [a, setA] = React.useState(3);␊
105+
106+
const onPress = () => {␊
107+
setA(5);␊
108+
$b = 3;␊
109+
};␊
110+
111+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, a), /*#__PURE__*/React.createElement("button", {␊
112+
onClick: onPress␊
113+
}, "Press"));␊
114+
};`

test/snapshots/test.ts.snap

48 Bytes
Binary file not shown.

test/test.ts

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -92,41 +92,41 @@ test('Check Arrow Function Scope', (t) => {
9292

9393
test('Multi Component Scope', (t) => {
9494
const code = `
95-
import * as React from "react";
96-
97-
let $b = 2;
98-
99-
const Component = () => {
100-
let $a = 1;
101-
102-
const onPress = () => {
103-
$a += 1;
104-
$b = 3;
105-
};
106-
107-
return (
108-
<div>
109-
<p>{$a}</p>
110-
<button onClick={onPress}>Press</button>
111-
</div>
112-
);
113-
};
114-
115-
const ComponentTwo = () => {
116-
let $a = 3;
117-
118-
const onPress = () => {
119-
$a = 5;
120-
$b = 3;
121-
};
122-
123-
return (
124-
<div>
125-
<p>{$a}</p>
126-
<button onClick={onPress}>Press</button>
127-
</div>
128-
);
129-
};
95+
import * as React from "react";
96+
97+
let $b = 2;
98+
99+
const Component = () => {
100+
let $a = 1;
101+
102+
const onPress = () => {
103+
$a += 1;
104+
$b = 3;
105+
};
106+
107+
return (
108+
<div>
109+
<p>{$a}</p>
110+
<button onClick={onPress}>Press</button>
111+
</div>
112+
);
113+
};
114+
115+
const ComponentTwo = () => {
116+
let $a = 3;
117+
118+
const onPress = () => {
119+
$a = 5;
120+
$b = 3;
121+
};
122+
123+
return (
124+
<div>
125+
<p>{$a}</p>
126+
<button onClick={onPress}>Press</button>
127+
</div>
128+
);
129+
};
130130
`
131131

132132
const result = compile(code)

0 commit comments

Comments
 (0)