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: add unit tests for the module #892

Merged
merged 11 commits into from Nov 2, 2023
Merged

Conversation

jrutila
Copy link
Sponsor Contributor

@jrutila jrutila commented Oct 30, 2023

πŸ”— Linked issue

#546

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • Tests

πŸ“š Description

The codebase is missing unit tests. This PR will add the test bench and some basic cases from where to start expanding the test base. The tests now test that the module setup works correctly. Next step would be to add tests for components.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel
Copy link

vercel bot commented Oct 30, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
ui βœ… Ready (Inspect) Visit Preview Nov 2, 2023 9:59am

@benjamincanac
Copy link
Member

Thanks for taking the initiative of starting this! 😊 Do you think it would make sense to use https://github.com/danielroe/nuxt-vitest?

@jrutila
Copy link
Sponsor Contributor Author

jrutila commented Oct 31, 2023

Do you think it would make sense to use https://github.com/danielroe/nuxt-vitest?

Definitely that could be used when testing the components. The package seems to be targeted more on testing nuxt applications instead of modules. Can look into it.

To prevent feature creep for this PR the component testing should probably be in different PR. Should I still update the contribution guidelines in doc for this PR? How about build process?

Copy link
Member

Not sure about the contribution guidelines as there is a draft PR that changes it already: #860

For the build process, you can just add a test step in .github/workflows/ci.yml and .github/workflows/ci-dev.yml.

@jrutila
Copy link
Sponsor Contributor Author

jrutila commented Nov 1, 2023

@benjamincanac I can't see what is the problem with Vercel. I added the test steps to the ci files.

@benjamincanac
Copy link
Member

Should be good now! 😊

@jrutila
Copy link
Sponsor Contributor Author

jrutila commented Nov 2, 2023

The CI seems to be ok and build passes. Is this PR ok to complete or should I add something to it, sill?

test/basic.spec.ts Outdated Show resolved Hide resolved
@benjamincanac
Copy link
Member

No I think it's a really good init! We can merge this and continue in other PRs. Thanks a lot! 😊

@benjamincanac benjamincanac merged commit ed4b5e0 into nuxt:dev Nov 2, 2023
2 checks passed
@jrutila jrutila deleted the feature/tests branch November 3, 2023 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants