-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable integration tests #1680
base: main
Are you sure you want to change the base?
Enable integration tests #1680
Changes from all commits
fec04fb
e8f0147
1b37bc0
80ffa3f
350a898
cd95135
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
# Get the latest content data from Strapi before run the tests | ||
npm run build:localContent | ||
CMS="FILE" | ||
# After get the latest content data from Strapi, run the tests | ||
npx vitest run --project=integration | ||
Comment on lines
+3
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused. I thought the idea is to run the test directly against strapi? why would we download content and force an offline test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was also my understanding? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeap, but I would need to make a big refactor in the tests and how Strapi gets slow after the update to the version 5 the tests might fail due the timeout (vitest problems). So getting the all current Strapi content and tests offline it'll be the same thing as testing directly against Strapi. And it runs fast as well, because I don't need to retrieve every single flow or content from strapi to test it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would strongly prefer a solution without shell script, like
npm run build:localContent && CMS="FILE" vitest run --project integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would you strongly prefer a solution without shell script? I did a shell script to avoid a long command line. And in case we need to add more options in the command line, adding in the shell script is easier than adding here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me: Much easier to understand whats going on + less files in the repo (especially hard-to-debug executables like shell scripts)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, it's much easier to read multiple lines in a shell script than to read a long single-line command. 😅