-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warnings during tests and prevent them from reoccurring #1769
Conversation
5b8c840
to
735d432
Compare
Rebased after adding Jest in #1382. This seems to still be working fine (try it by applying this, for example): diff --git a/blocks/api/test/registration.js b/blocks/api/test/registration.js
index d601ac5..6141bb8 100644
--- a/blocks/api/test/registration.js
+++ b/blocks/api/test/registration.js
@@ -36,6 +36,7 @@ describe( 'blocks', () => {
setUnknownTypeHandler( undefined );
setDefaultBlock( undefined );
console.error.restore();
+ console.error( 'hi :)' );
} );
describe( 'registerBlockType()', () => { |
735d432
to
c90bd80
Compare
I like the idea of promoting console errors to test errors unless explicitly wrapped with proper expect call 👍 |
19c4cf8
to
fcea6e8
Compare
080b7a5 is interesting code, but not the kind I'd like to merge, especially since this is only needed during test runs. Now taking a different approach that allows only these mysterious
|
I'll remove the whitespace from the table serialization test input which I'd imagine will fix the warning. |
This reverts commit c90bd800a2e63fbb32710f8c04b5f3ab37f0948f.
60309fd
to
d2954b8
Compare
👍 I guess this is OK, though it'd be nice to know more about what is happening here. |
We have a few warnings appearing during test suite runs:
(Output is from the test suite after checking out only the first commit in this branch.)
Like in PHPUnit, these should fail the build. The way of accomplishing this in JavaScript is a bit hacky but I think it is probably worth doing.
@gziolo - it looks like this may cause problems with Jest and #1382 (IMO adopting Jest is more important than this change). Thoughts?
@EphoxJames - I cannot figure out why these warnings about whitespace text nodes appear in test mode but not when saving/editing posts. Thoughts?