Type checking preset-typescript options#12460
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/34334/ |
6c7f049 to
c2a73b9
Compare
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 22c5830:
|
430c0d4 to
d654eed
Compare
| let old_babel_8_breaking_env; | ||
| beforeAll(() => { | ||
| old_babel_8_breaking_env = process.env.BABEL_8_BREAKING; | ||
| process.env.BABEL_8_BREAKING = "1"; | ||
| }); | ||
| afterAll(() => { | ||
| if (old_babel_8_breaking_env) { | ||
| process.env.BABEL_8_BREAKING = old_babel_8_breaking_env; | ||
| } else { | ||
| delete process.env.BABEL_8_BREAKING; | ||
| } | ||
| }); |
There was a problem hiding this comment.
Since we run tests with the BABEL_8_BREAKING flag on CI (and we can manually do it locally), we don't need to set it here.
I'm worried that this will fail on make prepublish, since in the prepublish build we strip the BABEL_8_BREAKING checks in the compiled code.
There was a problem hiding this comment.
Then it is pretty scary that the make prepublish actually passed. 😂
I will skip the test if BABEL_8_BREAKING does not present.
There was a problem hiding this comment.
Then it is pretty scary that the
make prepublishactually passed. 😂
I'm investigating 😁
There was a problem hiding this comment.
Ok, the test is not failing because it imports src, so the source is compiled just-in-time by Jest regardless of what we have in lib.
packages/babel-preset-typescript/test/normalize-options.spec.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Nicolò Ribaudo <[email protected]>
BABEL_8_BREAKINGflagsThis PR was derived from #10927. It focuses on checking
@babel/preset-typescriptoptions only.It uses the
BABEL_8_BREAKINGenv flags so we can test the Babel 8 behaviour onmain.It includes commits from #12457.Just realized that this PR does not depend on that one. Rebased.