Closed humphd closed 3 years ago
Moving the shim tests to the end of tests/index.js
doesn't affect it (e.g., skips all the other tests, only runs shim tests), so pulling these shims into the main tests at all somehow disrupts how the usual filer require works.
Hey, thanks for bringing this to my attention @humphd. I think it was running all of them for me but I was using npm run karma-mocha
. I will look into this as soon as I have time but may have to wait until the weekend if that's okay.
Thanks. It's not a big rush, but it's something I want fixed before I ship an update. The best fix might be to do multiple builds and not bother trying to make it all work in one? Not sure.
Thanks. It's not a big rush, but it's something I want fixed before I ship an update. The best fix might be to do multiple builds and not bother trying to make it all work in one? Not sure.
Do you mean to completely separate the shim tests from the rest?
Sure, we could even introduce a test that uses webpack vs. parcel to do the build, and does your tests as a separate process we run with npm-run-all
, so npm test
would trigger a few independent build/test runs. I think it might be hard to make these all work together, but maybe I'm wrong? Happy either way.
@humphd .......... my bad! I had describe.only in my tests so as not to run all tests when I was writing them. I removed it from one but forgot to remove it from the other three spec files I wrote. For future reference, is there a way you would normally go about running only a specific describe? (I usually use jest so am not very familiar with karma-mocha)
Oh, nice. I completely missed this too. I'd have to look what the right way with Karma is, too. I also usually use Jest, so I can't remember. We used karma-mocha for Filer due to wanting to have real indexeddb in tests vs. JSDOM.
Thanks for the follow-up, I'll review your PR.
I do prefer jest usually but it makes sense to use Karma for the reasons you mentioned.
By the way, I'm still happy to take a look at separating out the tests for the shims if you think this is necessary. However, I'd need to clarify what we want to get out of doing that as I'm not 100% sure why we would go down that route =P
Agreed, I don't think it's necessary, given the actual issue. I was anticipating a harder solution than removing .only :)
Fixed by #767
After merging https://github.com/filerjs/filer/commit/aacc8061cf761e7baff6fd1a842b0e9b7f0a1092 it looks like we're only running the shim tests now vs. the whole set of tests (cc @bcheidemann):