Skip to content

[WebProfilerBundle] Fix minify test after JS refactor #50849

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

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Jul 2, 2023

Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

This test makes sure the JS files are valid after we "minify" them by removing newlines. After the refactor of #50790, it was not updated correctly causing a red CI.

This fixes the test, and makes it more future proof.

@@ -23,8 +23,12 @@ class MinifyTest extends TestCase
public function testNoSingleLineComments()
{
$dir = \dirname(__DIR__, 2).'/Resources/views/Profiler';
$message = 'There cannot be any single line comment in this file. Consider using multiple line comment. ';
$this->assertTrue(2 === substr_count(file_get_contents($dir.'/base_js.html.twig'), '//'), $message);
$this->assertTrue(0 === substr_count(file_get_contents($dir.'/toolbar.css.twig'), '//'), $message);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about this CSS files ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this applies, // is not a valid CSS comment and CSS only supports the /* ... */ comment syntax.

@nicolas-grekas
Copy link
Member

Thank you @wouterj.

@nicolas-grekas nicolas-grekas merged commit 03e4b87 into symfony:6.4 Jul 3, 2023
@wouterj wouterj deleted the fix-webprofiler-tests branch July 3, 2023 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants