Skip to content
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

Convert var to const/let in the test/unit folder #12528

Merged
merged 3 commits into from
Oct 25, 2020

Conversation

timvandermeij
Copy link
Contributor

@timvandermeij timvandermeij commented Oct 25, 2020

The commit messages contain more information about the individual commits.

The test/unit folder counts for about 50% of the var usage in the entire test folder and used a mix of var and const/let. This commit series makes the entire test/unit folder use const/let consistently and allows us to enforce that unit tests are written with modern syntax, bringing us one step closer to enabling the ESLint no-var rule globally.

This allows us to enforce that `var` is not used anymore in the unit
tests to modernize the code and prevent subtle bugs.
This has been done automatically using ESLint's `--fix` argument.
This mainly involves the `crypto_spec.js` file which declared most
variables before their usage, which is not really consistent with the
rest of the codebase. This also required reformatting some long arrays
in that file because otherwise we would exceed the 80 character line
limit. Overall, this makes the code more readable.
@timvandermeij
Copy link
Contributor Author

/botio-linux unittest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/47bf401767ae0be/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/47bf401767ae0be/output.txt

Total script time: 4.26 mins

  • Unit Tests: Passed

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for doing this!

@timvandermeij timvandermeij merged commit 2251677 into mozilla:master Oct 25, 2020
@timvandermeij timvandermeij deleted the test-unit-no-var branch October 25, 2020 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants