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

Fix Javascript Unit Tests File Import Error #1296

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

njmulsqb
Copy link
Contributor

fixes #1103

Signed-off-by: Najam Ul Saqib <najamulsaqib@tutamail.com>
@thc202 thc202 changed the title 🐛 fix import of ava library using require Fix import of ava library using require Sep 20, 2023
@thc202
Copy link
Member

thc202 commented Sep 20, 2023

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 thc202 mentioned this pull request Sep 20, 2023
@njmulsqb
Copy link
Contributor Author

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

@psiinon
Copy link
Member

psiinon commented Sep 20, 2023

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.

@njmulsqb
Copy link
Contributor Author

njmulsqb commented Sep 20, 2023

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

@psiinon
Copy link
Member

psiinon commented Sep 20, 2023

Can you try ./gradlew check zapRunTests

@njmulsqb
Copy link
Contributor Author

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

@thc202
Copy link
Member

thc202 commented Sep 20, 2023

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

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

@njmulsqb
Copy link
Contributor Author

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?

@psiinon
Copy link
Member

psiinon commented Sep 20, 2023

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

Signed-off-by: Najam Ul Saqib <najamulsaqib@tutamail.com>
@njmulsqb njmulsqb changed the title Fix import of ava library using require Fix Javascript Unit Tests Sep 26, 2023
@njmulsqb
Copy link
Contributor Author

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 njmulsqb changed the title Fix Javascript Unit Tests Fix Javascript Unit Tests File Import Error Sep 26, 2023
@psiinon
Copy link
Member

psiinon commented Sep 26, 2023

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

Signed-off-by: Najam Ul Saqib <najamulsaqib@tutamail.com>
@njmulsqb
Copy link
Contributor Author

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

Signed-off-by: Najam Ul Saqib <najamulsaqib@tutamail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Running ava fails with SyntaxError: Cannot use import statement outside a module
3 participants