-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Ensure that all block fixtures end with newlines #2034
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified that there are no modified files when running:
gutenberg (fix/block-fixtures-newlines) $ npx rimraf blocks/test/fixtures/*.serialized.html
gutenberg (fix/block-fixtures-newlines) $ npx rimraf blocks/test/fixtures/*.json
gutenberg (fix/block-fixtures-newlines) $ GENERATE_MISSING_FIXTURES=y npm run test-unit
const serializedActual = serialize( blocksActual ); | ||
// `serialize` doesn't have a trailing newline, but the fixture | ||
// files should. | ||
const serializedActual = serialize( blocksActual ) + '\n'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we trim here in case serialize
changes in the future to add its own trailing newline or... update this logic if/when that time comes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update when the time comes; require an exact match so that we know if this behavior changes.
I think the current behavior is correct for post_content
, FWIW.
Eh, probably should have waited for the CI build to pass before merging, but I did the same verification locally. |
In following up on #1929 (comment), I'm finding that |
|
I suppose this is because the initial HTML files contain a trailing newline, and so we should remove the |
Enable Cover Block for Production
Follow-up to #1929. The whitespace in these fixture files has been flipping back and forth a bit, let's put a stop to that.