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: clean up remaining core function tests, introduce testing utilities and an ISO helper #351

Merged
merged 7 commits into from
Dec 12, 2023

Conversation

Tlacenka
Copy link
Collaborator

@Tlacenka Tlacenka commented Dec 6, 2023

Closes #215 #264

This PR is the last one for the core package test refactor. In it, I do the following:

  • Minimise test scope (this means mocking unrelated logic, moving tests to minimal entity).
  • Improve test descriptions and test flow.
  • Introduce ISO Regexp to help with checking date values.
  • Introduce minimal mocks to be reused when a config is required.
  • I fix the coverage CI (previously, core tests were failing) by adding integration-test target to testing-utils and minimising fs dependence of core tests. Run here. 🚥 🟢
  • testing-utils are now buildable due to nx buildable rule.

@Tlacenka Tlacenka self-assigned this Dec 6, 2023
@Tlacenka Tlacenka requested a review from IKatsuba December 11, 2023 10:39
@Tlacenka Tlacenka force-pushed the core-test-refactor-2 branch from 2b567b1 to 82347ff Compare December 12, 2023 09:55
@Tlacenka Tlacenka linked an issue Dec 12, 2023 that may be closed by this pull request
@Tlacenka Tlacenka changed the title test(core): clean up remaining core function tests, introduce testing utilities and an ISO helper test: clean up remaining core function tests, introduce testing utilities and an ISO helper Dec 12, 2023
Copy link
Contributor

@MishaSeredenkoPushBased MishaSeredenkoPushBased left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Collaborator

@matejchalk matejchalk left a comment

Choose a reason for hiding this comment

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

Great now all our tests finally pass when run at once 🎉 Big step forward for stability 👏

packages/core/src/lib/collect-and-persist.unit.test.ts Outdated Show resolved Hide resolved
packages/core/src/lib/collect-and-persist.unit.test.ts Outdated Show resolved Hide resolved
packages/core/src/lib/collect-and-persist.unit.test.ts Outdated Show resolved Hide resolved
packages/core/src/lib/upload.unit.test.ts Outdated Show resolved Hide resolved
testing-utils/package.json Outdated Show resolved Hide resolved
testing-utils/project.json Outdated Show resolved Hide resolved
@Tlacenka Tlacenka force-pushed the core-test-refactor-2 branch from 82347ff to 71f7272 Compare December 12, 2023 11:06
@github-actions github-actions bot added the 🦾 CI/CD continuous integration and deployment label Dec 12, 2023
@Tlacenka Tlacenka requested a review from matejchalk December 12, 2023 11:12
matejchalk
matejchalk previously approved these changes Dec 12, 2023
packages/core/src/lib/collect-and-persist.unit.test.ts Outdated Show resolved Hide resolved
@Tlacenka Tlacenka merged commit b1f13c3 into main Dec 12, 2023
18 checks passed
@Tlacenka Tlacenka deleted the core-test-refactor-2 branch December 12, 2023 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦾 CI/CD continuous integration and deployment 🧩 cli 🧩 core 🔬 testing writing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling files in tests core package test refactor
3 participants