Skip to content

Commit de535b1

Browse files
committed
[playground] Fix broken tests
Our e2e setup with monaco is kinda brittle since it relies on the dom. It seems like longish text gets truncated so let's just simpify all these test cases.
1 parent 0dac86f commit de535b1

15 files changed

+143
-343
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
function TestComponent(t0) {
2-
  const $ = _c(2);
3-
  const { x } = t0;
4-
  let t1;
5-
  if ($[0] !== x) {
6-
    t1 = <Button>{x}</Button>;
7-
    $[0] = x;
8-
    $[1] = t1;
9-
  } else {
10-
    t1 = $[1];
11-
  }
12-
  return t1;
13-
}
1+
function TestComponent(t0) {
2+
const $ = _c(2);
3+
const { x } = t0;
4+
let t1;
5+
if ($[0] !== x) {
6+
t1 = <Button>{x}</Button>;
7+
$[0] = x;
8+
$[1] = t1;
9+
} else {
10+
t1 = $[1];
11+
}
12+
return t1;
13+
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
function MyApp() {
2-
  const $ = _c(1);
3-
  let t0;
4-
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
5-
    t0 = <div>Hello World</div>;
6-
    $[0] = t0;
7-
  } else {
8-
    t0 = $[0];
9-
  }
10-
  return t0;
11-
}
1+
function MyApp() {
2+
const $ = _c(1);
3+
let t0;
4+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
5+
t0 = <div>Hello World</div>;
6+
$[0] = t0;
7+
} else {
8+
t0 = $[0];
9+
}
10+
return t0;
11+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function TestComponent(t0) {
2+
"use memo";
3+
const $ = _c(2);
4+
const { x } = t0;
5+
let t1;
6+
if ($[0] !== x) {
7+
t1 = <Button>{x}</Button>;
8+
$[0] = x;
9+
$[1] = t1;
10+
} else {
11+
t1 = $[1];
12+
}
13+
return t1;
14+
}

compiler/apps/playground/__tests__/e2e/__snapshots__/page.spec.ts/function-scope-no-directive-arrow-function-expression-output.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

compiler/apps/playground/__tests__/e2e/__snapshots__/page.spec.ts/function-scope-use-memo-arrow-function-expression-output.txt

Lines changed: 0 additions & 32 deletions
This file was deleted.

compiler/apps/playground/__tests__/e2e/__snapshots__/page.spec.ts/function-scope-use-memo-function-declaration-output.txt

Lines changed: 0 additions & 32 deletions
This file was deleted.

compiler/apps/playground/__tests__/e2e/__snapshots__/page.spec.ts/function-scope-use-no-memo-function-declaration-output.txt

Lines changed: 0 additions & 32 deletions
This file was deleted.

compiler/apps/playground/__tests__/e2e/__snapshots__/page.spec.ts/function-scope-use-no-memo-function-expression-output.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
function anonymous_1() {
2-
  const $ = _c(1);
3-
  const handleClick = _temp;
4-
  let t0;
5-
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
6-
    t0 = <h1 onClick={handleClick}>Welcome to the App!</h1>;
7-
    $[0] = t0;
8-
  } else {
9-
    t0 = $[0];
10-
  }
11-
  return t0;
1+
function TestComponent(t0) {
2+
const $ = _c(2);
3+
const { x } = t0;
4+
let t1;
5+
if ($[0] !== x) {
6+
t1 = <Button>{x}</Button>;
7+
$[0] = x;
8+
$[1] = t1;
9+
} else {
10+
t1 = $[1];
11+
}
12+
return t1;
1213
}
13-
function _temp() {
14-
  console.log("Header clicked");
15-
}

compiler/apps/playground/__tests__/e2e/__snapshots__/page.spec.ts/module-scope-use-no-memo-function-expression-output.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)