zap-hud icon indicating copy to clipboard operation
zap-hud copied to clipboard

Fix Failing JS Unit Tests & File Import Error

Open njmulsqb opened this issue 2 years ago • 15 comments

The code had two failing JS unit tests which has been fixed image

also fixes #1103

njmulsqb avatar Sep 20 '23 06:09 njmulsqb

CI should be changed to run the tests, not only to ensure that this is fixed but to not regress again.

For follow ups better use a different branch name, vue3 is misleading.

thc202 avatar Sep 20 '23 06:09 thc202

CI issue is different; this PR resolves the issue that was stopping the execution of tests locally (atleast)

njmulsqb avatar Sep 20 '23 10:09 njmulsqb

So you cant run the test locally? what error messages do you get? I can run them, although the Firefox one always fails for me.

psiinon avatar Sep 20 '23 10:09 psiinon

I am using npm run test to invoke ava and it is giving following error to me image This PR fixes it; afterwards the output is something like this: image

njmulsqb avatar Sep 20 '23 10:09 njmulsqb

Can you try ./gradlew check zapRunTests

psiinon avatar Sep 20 '23 10:09 psiinon

Yeah its working fine. Isn't it utilizing Java tests? Why can't we run ava directly?

njmulsqb avatar Sep 20 '23 10:09 njmulsqb

This PR fixes it; afterwards the output is something like this:

That error shows utils is not defined so the fix is not complete.

thc202 avatar Sep 20 '23 10:09 thc202

The fix is just for the import statement; not for the whole unit tests file.

Second, I can see the gradle job is running java tests, and not ava ones. Should I focus on Java unit tests or on JS ones?

njmulsqb avatar Sep 20 '23 10:09 njmulsqb

For me the java tests are the most important, but the js ones would be good to fix too..

psiinon avatar Sep 20 '23 11:09 psiinon

This PR fixes it; afterwards the output is something like this:

That error shows utils is not defined so the fix is not complete.

It is complete now

njmulsqb avatar Sep 26 '23 08:09 njmulsqb

Task :npmLintAllHud FAILED - should be an easy one to fix 😁

psiinon avatar Sep 26 '23 09:09 psiinon

Is it possible to execute only the failing unit test and not zapRunTests each time?

njmulsqb avatar Oct 13 '23 05:10 njmulsqb