Skip to content

Conversation

pwizla
Copy link
Collaborator

@pwizla pwizla commented Sep 18, 2025

This PR merges content from 2 blog posts published on Unit testing and tries to update them for Strapi 5

TODO:

  • integrate blog posts content
  • refine content
  • fix why example tests are failing
  • rework content with the fixed test examples

Direct preview link 👉 here

@pwizla pwizla self-assigned this Sep 18, 2025
Copy link

vercel bot commented Sep 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
documentation Ready Ready Preview Comment Oct 3, 2025 2:48pm

@github-actions github-actions bot added the internal PRs created by the Strapi core team label Sep 18, 2025
@pwizla pwizla added this to the 6.9.2 milestone Sep 19, 2025
@pwizla pwizla modified the milestones: 6.9.2, 6.9.3 Oct 1, 2025
@pwizla pwizla marked this pull request as ready for review October 3, 2025 14:37
@pwizla pwizla requested a review from meganelacheny as a code owner October 3, 2025 14:37
@pwizla pwizla changed the title Update Unit testing Rework the Unit testing for Strapi 5 Oct 3, 2025
@ancashoria
Copy link

Hey, it's great you're updating the testing page.
I'm trying to setup a Strapi testing environment using sqlite and I'd like to mention one thing I have stumbled upon because it seems it's still present in the updated article.

This section: https://documentation-git-cms-testing-reworked-strapijs.vercel.app/cms/testing#set-up-a-testing-environment

When I have two different files for the database config, only one of them ends up in dist/config/database.js and since my test setup uses the dist folder, my test setup breaks if I run yarn dev setup.

const app = await createStrapi({
      appDir: "./",
      distDir: "./dist",
    }).load();

Basically if I run yarn test after yarn dev, my testing fails.

Hopefuly this helps somehow.

@ancashoria
Copy link

ancashoria commented Oct 9, 2025

Is there a way to bootstrap the sqlite db based on a template? My API tests expect some data already configured.

@pwizla
Copy link
Collaborator Author

pwizla commented Oct 9, 2025

Hi @ancashoria, thanks for your interest and kind words regarding this PR :)

To be honest, I only have basic experience with testing, but as a technical writer for Strapi, I’m doing my best, with the help of AI-based tools, to update this page. I’m afraid your feedback points to issues that are a bit beyond my current skill set, but I’ll try to get help from Strapi engineers to improve the PR (it still needs their review, anyway 👀).

I’ll keep you posted!

@pwizla pwizla changed the title Rework the Unit testing for Strapi 5 Rework the Unit testing page for Strapi 5 Oct 10, 2025
@pwizla pwizla removed this from the 6.9.4 milestone Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal PRs created by the Strapi core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants