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

JS tests are not executed #29250

Closed
nickvergessen opened this issue Oct 15, 2021 · 2 comments
Closed

JS tests are not executed #29250

nickvergessen opened this issue Oct 15, 2021 · 2 comments
Labels
1. to develop Accepted and waiting to be taken care of bug high javascript
Milestone

Comments

@nickvergessen
Copy link
Member

Some big brain time here.
With some update the regex pattern of jest changed (--testRegex is available to configure it)

To test

modify

"test": "jest",

to

    "test": "jest core/",

Since then only one test in core is executed:

> nextcloud@1.0.0 test
> jest core/

 PASS  core/src/tests/OC/requesttoken.spec.js
  request token
    ✓ reads the token from the document (4 ms)
    ✓ remembers the updated token (1 ms)
    @nextcloud/auth integration
      ✓ fires off an event for @nextcloud/auth (2 ms)

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        1.335 s
Ran all test suites matching /core\//i.

With matching pattern

    "test": "jest core/ --testRegex='[sS]pec.[tj]s'",

the result is much worse:

Test Suites: 15 failed, 1 passed, 16 total
Tests:       244 failed, 3 passed, 247 total
Snapshots:   0 total
Time:        7.081 s

I guess the tests were not adjusted since they were not executed anymore.

cc @nextcloud/server-frontend

@nickvergessen nickvergessen added bug 1. to develop Accepted and waiting to be taken care of javascript labels Oct 15, 2021
@nickvergessen
Copy link
Member Author

We can also rename all out test files, so they match the default pattern again .spec.js
But fixing still needs to be done afterwards

@skjnldsv skjnldsv added this to the Nextcloud 23 milestone Oct 15, 2021
@skjnldsv skjnldsv added the high label Oct 15, 2021
@blizzz blizzz modified the milestones: Nextcloud 23, Nextcloud 24 Nov 30, 2021
@artonge
Copy link
Contributor

artonge commented Feb 2, 2022

Looking into it with more expertise about NC front-end tests, it looks to me that everything is alright.

This PR introduced jest as a test runner to replace mocha, but there was only one test executed at the time. All the other tests are executed by karma.

Closing, feel free to reopen if I am wrong.

@artonge artonge closed this as completed Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug high javascript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants