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

exclude tests in distribution, test esm and cjs #47

Merged
merged 11 commits into from
Sep 9, 2024

Conversation

heyAyushh
Copy link
Contributor

@heyAyushh heyAyushh commented Aug 28, 2024

Problem

  • test file was in src folder hence, included in the distribution,
    which increases unnecessary increase in bundle size,
  • tests were all in one file, risking E2BIG errors as the file size grew
  • difficult to manage and locate specific tests
  • running tests in a single file can be inefficient and error-prone

Solution

  • moved tests to separate files in the tests folder to prevent file size issues
  • seperated test file into multiple test files for better organisation
  • added esbuild register to test esm code (default npm run test behavior)
  • added steps to test cjs build with tsc (in ci esm and cjs both should be tested)
  • removed tsup from package dev dependencies

this change improves test organization, stability, and enhances testing capabilities without increasing the binary size.

@heyAyushh heyAyushh changed the title exclude tests in distribution exclude tests in distribution, add jest Aug 28, 2024
@mikemaccana
Copy link
Contributor

Glad that adding jest won't increase the distribution size, I just don't see the need to add jest as a dev dependency. Asides from jest not needing to exist - this repo already has a test suite using node's native tools, jest has a bad reputation (particularly in the node space) for creating hard to debug edge cases since it monkey patches various libraries.

This is a good PR otherwise - I'd just move the tests into their own folder, without adding jest.

@heyAyushh heyAyushh changed the title exclude tests in distribution, add jest exclude tests in distribution, test esm and cjs Sep 6, 2024
@mikemaccana mikemaccana merged commit be6e684 into solana-developers:main Sep 9, 2024
1 check passed
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.

2 participants