Skip to content
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

bug: impossible to make individual unit test #4237

Closed
3 tasks done
JEricaM opened this issue Apr 6, 2023 · 3 comments
Closed
3 tasks done

bug: impossible to make individual unit test #4237

JEricaM opened this issue Apr 6, 2023 · 3 comments
Assignees

Comments

@JEricaM
Copy link

JEricaM commented Apr 6, 2023

Prerequisites

Stencil Version

3.2.0

Current Behavior

Not able, from CLI , to run individual unit tests.

Expected Behavior

This command should run the tests only for COMPONENT instead, runs all the test.
npx stencil test --e2e --spec component

System Info

No response

Steps to Reproduce

Launch npx stencil test --e2e --spec component where component is the name of the individual test

Code Reproduction URL

https://github.com/JEricaM/StencilUserTest

Additional Information

I've already checked this previous issue
#3276
but I think that the bug is still present.
I've also done the steps from alicewriteswrongs #3276 (comment) but nothing worked. Always all the tests runs.

@ionitron-bot ionitron-bot bot added the triage label Apr 6, 2023
@alicewriteswrongs alicewriteswrongs self-assigned this Apr 6, 2023
@alicewriteswrongs
Copy link
Contributor

Hey @JEricaM thanks for filing this issue and sorry that you're having trouble running your tests.

I was able to make the following edit to your repro to get just the tests in src/components/my-component/my-component.spec.tsx to run:

diff --git a/package.json b/package.json
index 9bc612c..58fb33d 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,7 @@
     "build": "stencil build --docs",
     "start": "stencil build --dev --watch --serve",
     "test": "stencil test --spec --e2e",
-    "test-comp": "stencil test --spec my-component.spec.tsx",
+    "test-comp": "stencil test --spec -- my-component.spec.tsx",
     "test.watch": "stencil test --spec --e2e --watchAll",
     "generate": "stencil generate"
   },

Would you mind trying that out and seeing if it works for you?

@alicewriteswrongs alicewriteswrongs added the Awaiting Reply This PR or Issue needs a reply from the original reporter. label Apr 6, 2023
@ionitron-bot ionitron-bot bot removed the triage label Apr 6, 2023
@JEricaM
Copy link
Author

JEricaM commented Apr 6, 2023

hi @alicewriteswrongs , thanks for the quick reply.
Can I confirm you that now it works! thank you very very much!

@ionitron-bot ionitron-bot bot removed the Awaiting Reply This PR or Issue needs a reply from the original reporter. label Apr 6, 2023
@alicewriteswrongs
Copy link
Contributor

Great, happy to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants