Building out tests for Meteor in 2026

We have a mature production Meteor app on 3.3.2 running for several years and have never used any tests. No unit tests, no integration tests, nothing. And yes, we’ve had some gnarly bugs slip out the door a few times. But we also innovate quickly. It’s just the trade-off we chose.

I’ve had my eye on a few of these test-writing services for the last few years, like QA Wolf and others, but never really investigated. I did plan on out-sourcing it as it’s just something that I always felt would take up too much time. Until AI.

Just curious if anyone is using AI to generate good tests and/or any other approaches, like the services above?

Also, what is the framework of choice for testing in 2026 for Meteor? (Sorry, I know this gets posted a lot).

2 Likes

Just trying to get test running for Literary Universe as well. I’m currently focusing on Cypress and having AI get the initial stuff running. Honestly the testing story is not optimal.

One issue is having separate DB for testing. So either external DB locally, or using METEOR_LOCAL_DIR=.meteor/test to get a separate setup just to run tests. Beyond that I’m still exploring.

1 Like

Cypress for 2e2 and componants
mocha with meteor test for unit tests (methods, composables, …)

1 Like

As someone who was using Cypress for a few years, I fell in love with Playwright (and Puppeteer before that) – it’s much more developer-friendly, with no magic, and full TypeScript support. And we expose a few “internal” methods for tests, e.g., for triggering cron jobs in tests (which, I was told, helps with generating tests using AI).

As for other tests, we try to isolate Meteor code and test as much as possible with plan Vitest. For the rest we’re stuck with an old version of universe:e2e.

1 Like

I thought I’d write up some notes on my current test setup, now that I’ve got it working with Meteor 3.x. I hope this is helpful to anyone:

https://gist.github.com/bukaicode/c10e4f9fdd0479824fa6bed168a1cb63

And YES we need a clear, modern testing approach for Meteor and better documentation.

4 Likes

We have opted to only test ddp/http level plus some internal algorithms and a few happy path ui tests using puppeteer.

I wrote a post about how here:

1 Like

Wow, what a project! Thanks for this. I assume all this is pre-AI? Have you filed a bug with Meteor about meteortesting:mocha always loading?

2 Likes

Yeah, most of the testing work was pre-AI, but it has helped me expand my test coverage more quickly and has cleaned up some of my custom cypress commands, etc.

I haven’t filed a bug because most of the time I think I’m just being an ignorant self-taught dev and maybe I just misread the instructions or something LOL. I guess if I could get a vote of confidence that it is a bug then I would report. Looking at the current documentation again, it definitely says use

meteor add meteortesting:mocha

which breaks my acceptance test setup.

1 Like

How did you go about migrating from Cypress to PlayWright?

Depending on what you test, my approach is to have three clear ways to describe tests, each with a specific purpose.

For pure function logic, the idea is isolation and portability. I would recommend Jest, Vitest, or another modern and fast test environment, focused on speed and standard compatibility. By pure logic I mean code that could be migrated to other codebases not using Meteor. Think of functions that do one thing, without accessing Meteor-specific APIs or Atmosphere packages, at most using standard NPM packages. These tests should be fast, framework-agnostic and easy to maintain. In Jest and similar tools you can always mock Meteor APIs, but I usually don’t rely on it much, for Meteor specific testing I use another strategy for testing.

For integration logic, I use meteortesting:mocha. The idea here is to validate how your business logic works inside the real Meteor environment. I rely on the current Meteor testing infrastructure to test real interactions. It can be slower, but it lets you filter tests and keep a good dev loop, while matching the final runtime behavior. Here you directly test Meteor-specific APIs such as Mongo collections, methods, and subscriptions.

For E2E tests, the idea is to describe real use cases from your frontend and backend expectations. I go with Playwright because it is stable and designed to reduce flaky behavior. It also provides automatic recording of actions in your frontend, which makes it easier to write specs. These tests validate the full behavior of the app from the user perspective.

Of course, E2E provides the most behavior coverage since it tests the full presentation of your app and everything involved. The idea is not to test everything, but to identify the critical points and focus on what gives you better coverage and maintenance.

In the future, on the Meteor core side, hopefully we can rethink test tools and how we integrate them, so testing can evolve beyond Mocha and support faster and new strategies like snapshot testing. Testing in Meteor should evolve to support faster and more flexible strategies.

Maybe after Rspack integration, we could consider rstest as a quick win for Meteor-side testing improvements.

2 Likes

I think the gist from @travismd78 could well be placed in the docs as part of testing guide :100:

1 Like

To innovate quickly, we use E2E tests to cover our needs. Not too restrictive that it can slow us down much, but not too loose that it covers our asses. We have 2 sets: (1) quick E2Es that cover all the happy paths (runs on every merge); (2) nightlies that cover critical flows, including fixes for critical bugs encountered in production.

I would love the idea of an E2E AI test that continuously updates as the app changes. I would definitely add that to our nightlies if available.

1 Like

We also moved from Cypress to Playwright. It’s so much nicer to write the tests and extend it and far clearer in what re-runs/retrys so you have fewer flaky tests (but never none unforuntately!). One of the main things that made us change was also being able to call methods directly - cypress has some weird serialisation going and would always corrupt dates. I can’t remember the details but it drove us crazy.

How did you go about migrating from Cypress to PlayWright?

This was one of my first uses of AI and was fairly easy. I made a list of rules, this maps to that sort of thing and it did 90%. It should be much easier now.

One thing I do miss was the GUI for cypress was better although the PW one has come along a lot since.

2 Likes

As usual: keep the old tests running, and create new ones in the new tool. Once you have enough done, you most likely have enough helpers and patterns too, so it’s trivial to migrate the old ones.

I spent a couple of hours for Gemini AI to create E2E tests in Playwright for our complicated setup of an ElectronJS app, frontend and backend on MeteorJS, landing page as a static on AWS S3 and MongoDb obviously.

From the prompt to get all these different apps and services to get connected and up and running it took AI 20 minutes.

The next hours were spent on let AI write tests on the user journey from clicking on the sign-up button on the landing page, first up MeteorJS, load a minimal database, go through the passwordless login in the ElectronJS app (after building it) including entering token.

So I was actually amazed at the speed and how well Gemini handled it.

Backend itself has over 1,000 tests, our on-Prem app slightly over 200 long running tests as it handles DNA data (which is quite big).

1 Like