-
Notifications
You must be signed in to change notification settings - Fork 0
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/ADF-1166/ESlint errors in tests of utils #155
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.
Looks good and tests run well after refactoring, but please check my comment, may be you'll want to fix quotes
test/util/mathsEvaluator/test.js
Outdated
console.log(err); | ||
return 'Syntax error!'; | ||
} | ||
} | ||
|
||
function showResult(expression, result) { | ||
var $expr = $('<p class="expression">' + expression + '</p>'); | ||
var $res = $('<p class="result">' + result + '</p>'); | ||
var $expr = $(`'<p class="expression">${expression}</p>'`); |
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.
Despite the fact $expr
is not the same – '
are left in place after the refactoring) this test doesn't fail
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.
Actually, it applies to a visual test. The extraneous quotes were displayed on the example calculator, they are not part of any test. Not a big issue, but better to fix indeed, the result will look neater.
Version
There are 0 BREAKING CHANGE, 0 feature, 0 fix |
Related to: https://oat-sa.atlassian.net/browse/ADF-1166
Summary
Fix the ESLint error in the unit tests for
tao-core-utils
.Note: as the changes are pretty heavy, I split them all into several pull requests.
Details
This pull request only targets the
test/util/*
part of the library.The full picture can be seen from the main branch which contains all the fixes: https://github.com/oat-sa/tao-core-sdk-fe.git#fix/ADF-1166/eslint-errors
What has been made:
eslint --fix
, then adjust the changes in case by case (mostly string literals).apply()
)var
byconst
orlet
(but not in all places, only in the touched files when it was not adding too much noise)How to test
npm i
npm run lint:test
, errors and warnings coming from theutils
folder should have gone.npm run test utils
"@oat-sa/tao-core-sdk": "https://github.com/oat-sa/tao-core-sdk-fe.git#fix/ADF-1166/eslint-errors",
, then checking the unit tests and playing with TAO