Recommendation for build testing #2714
Unanswered
make-github-pseudonymous-again
asked this question in
Q&A
Replies: 2 comments 4 replies
-
If you can import individual classes / functions / components from your release build then you can write the tests against those. If that's not an option, perhaps you can do some integration tests against the release build, and hope for the best? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Could we exploit import maps? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have AVA setup to test the source files transpiled on-the-fly via Babel. For a long time I used Babel to produce package release builds. Since the same tool/config was used for testing and building I was not too worried that something would differ between temporary testing builds and release builds. Hence I did not bother to test release builds assuming everything would work without problem. I depend on some of these released packages in some real projects and never had a problem so far.
Now, I started to use microbundle instead of babel to produce release builds. Here, I am less confident that everything will go smoothly. I already noticed some discrepancies, but nothing too worrying so far (EDIT: here is a worrying one). Just to be on the safe side, how would one approach testing both the sources and the build output with ava. Currently, my test code imports the sources through some relative path (e.g.
../../src/index.js
) hardcoded inside each test file. I thought about passing command line arguments to ava, then using some dynamic requirerequire(process.argv[2])
, but I am not sure this is such a good idea. Is there any standard solution to this problem? Is this a real problem?Beta Was this translation helpful? Give feedback.
All reactions