Repository navigation
Commit 76aafc1
committed
test(javascript): assert what load() owes, not what Deno can import
`should install onto terser` asserted that under Deno `phases` is empty,
because Deno could not import terser's own sources when the test was
written. It sometimes can, and then the test fails — it went red once on
#22243, a pull request touching only CSS fixtures, and cost a re-run of a
21-minute job to establish it was not that change's doing.
Which sources a runtime reaches is the one thing `load` is written to
tolerate: it catches any failure and hands back terser's published entry
point. So the runtime is the wrong thing to assert. What `load` owes
everywhere is that it installed phases this build declares and nothing
else, and Node, which always reaches the sources, still owes the whole
set — both of which this now states.
The fallback path stays covered by behaviour rather than by a hardcoded
outcome: every `should mangle exactly as terser does` case compares
webpack's `minify` against terser's own, whichever way `load` resolved.1 parent e2023b0 commit 76aafc1
1 file changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
96 | 101 | | |
97 | 102 | | |
98 | | - | |
99 | | - | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| |||
0 commit comments