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

test(core): Move unit tests closer to testable components (no-changelog) #10287

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

tomi
Copy link
Contributor

@tomi tomi commented Aug 2, 2024

Summary

Unit tests have been residing in test/unit/ directory. We want to them to be closer to the source files. This moves all the unit tests to __tests__ directories next to the components that are being tested.

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@@ -25,6 +24,36 @@ import { ProjectRepository } from '@/databases/repositories/project.repository';

const ownershipService = mockInstance(OwnershipService);

function mockNodeTypesData(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved from test/unit/Helpers.ts

* the macrotask queue and so called at the next iteration of the event loop
* after all promises in the microtask queue have settled first.
*/
export const flushPromises = async () => await new Promise(setImmediate);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved from test/unit/Helpers.ts

Unit tests have been residing in `test/unit/` directory. We want to them to be closer
to the source files. This moves all the unit tests to `__tests__` directories next to
the components that are being tested.
@tomi tomi force-pushed the test-move-cli-unit-tests-closer-to-test-target-files branch from c926395 to b4d89c8 Compare August 2, 2024 15:26
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Aug 2, 2024
Copy link
Member

@netroy netroy left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

Copy link

cypress bot commented Aug 5, 2024



Test summary

390 0 0 0Flakiness 0


Run details

Project n8n
Status Passed
Commit e69b91f
Started Aug 5, 2024 9:56 AM
Ended Aug 5, 2024 10:01 AM
Duration 04:42 💡
OS Linux Debian -
Browser Electron 118

View run in Cypress Cloud ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud

Copy link
Contributor

github-actions bot commented Aug 5, 2024

✅ All Cypress E2E specs passed

@tomi tomi merged commit afa43e7 into master Aug 5, 2024
32 checks passed
@tomi tomi deleted the test-move-cli-unit-tests-closer-to-test-target-files branch August 5, 2024 09:12
MiloradFilipovic added a commit that referenced this pull request Aug 5, 2024
* master:
  feat(editor): Auto-add LLM chain for new LLM nodes on empty canvas (#10245)
  fix(core): Fix user telemetry bugs (#10293)
  refactor(core): Remove stray log from telemetry event relay (no-changelog) (#10295)
  refactor(core): Decouple user events from internal hooks (no-changelog) (#10292)
  feat(core): Support community packages in scaling-mode  (#10228)
  test(core): Move unit tests closer to testable components (no-changelog) (#10287)
  fix(core): Webhook and form baseUrl missing (#10290)
  refactor(core): Port cache config (no-changelog) (#10286)
ivov added a commit that referenced this pull request Aug 6, 2024
Import paths were different at 1.45 and have seen changes e.g. with #10287
@janober
Copy link
Member

janober commented Aug 7, 2024

Got released with n8n@1.54.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants