Allow testing logs with @babel/helper-transform-fixture-test-runner#10326
Allow testing logs with @babel/helper-transform-fixture-test-runner#10326nicolo-ribaudo merged 6 commits intobabel:masterfrom
@babel/helper-transform-fixture-test-runner#10326Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11321/ |
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11306/ |
| const taskOptsLoc = resolve(taskDir + "/options"); | ||
| if (taskOptsLoc) extend(taskOpts, require(taskOptsLoc)); | ||
|
|
||
| const taskLogLoc = resolve(taskDir + "/expected-log.txt"); |
There was a problem hiding this comment.
The debug-fixtures in preset-env is testing against stdout.txt and stderr.txt. I think we could keep consistency here? And it would be great if preset-env does not log to test output after this PR gets merged.
440da56 to
6228c59
Compare
| } catch (e) { | ||
| if (!process.env.OVERWRITE) throw e; | ||
|
|
||
| console.log(`Updated test file: ${expectedLoc}`); |
There was a problem hiding this comment.
If we don't restore the console.log mock, would this line go to the actualLogs?
There was a problem hiding this comment.
I don't think this is expected. Updated test file: foo.js is used to remind the developer and therefore should always print to stdout, regardless of validateLogs.
There was a problem hiding this comment.
Yeah, I meant: "You are right, I will fix it" 😅
This is used by #10325, and it would also allow to clean our tests console output and to remove the distinction between fixtures and debug-fixtures in preset-env.