get-convex / convex-test

Testing harness for pure-JS Convex tests
Apache License 2.0
3 stars 1 forks source link

Work with test runners other than Vitest #9

Open itsMapleLeaf opened 3 weeks ago

itsMapleLeaf commented 3 weeks ago

Due to the use of Vitest-specific APIs, convex-test can't be used with any test runner other than Vitest, such as bun test:

❯ bun test
bun test v1.1.12 (43f0913c)

convex\entities\users.test.ts:
876 | }
877 | function getModuleCache() {
878 |     return global.Convex.modules;
879 | }
880 | function moduleCache(specifiedModules) {
881 |     const modules = specifiedModules ?? import.meta.glob("../../../convex/**/*.*s");
                                              ^
TypeError: import.meta.glob is not a function. (In 'import.meta.glob("../../../convex/**/*.*s")', 'import.meta.glob' is undefined)
xixixao commented 3 weeks ago

Indeed. I think we're OK with this for now, but if you can get another runner working (and supporting everything vitest currently supports), we'd look at a PR.