You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stencil generate: generated Spec Test .spec.tsx file with import component path #2396
Current behavior: stencil generate test-comp with Spec Test enabled as follow
? Which additional files do you want to generate? ›
Instructions:
↑/↓: Highlight option
←/→/[space]: Toggle selection
a: Toggle all
enter/return: Complete answer
◉ Stylesheet (.css)
◉ Spec Test (.spec.tsx)
◉ E2E Test (.e2e.ts)
will generate in src/components/test-component/test directory the test-comp.spec.tsx file with the following import statement:
import{TestComponent}from'./mt-image';
Expected behavior:
It should be:
import{TestComponent}from'../mt-image';// NOTE THE .. instead of .
Culprit:
In the file src/cli/tasks/task-generate.ts, the method getSpecTestBoilerplate has the following line:
For the love of god, dear stencil team. Stop breaking generate! This is a massive issue for existing code bases with loads of components that all need to be refactored to the new way of generate every time you change it, and you keep changing (and breaking!!!) it without ANY community communication! At least do the changes to generate in one fell swoop so we don't have to continually refactor all existing components! And document them in the changenotes!
Reacted by El Pupi, David Pertiller and Asher Foster
Activity
alexandertrefz commentedon May 13, 2020
For the love of god, dear stencil team. Stop breaking generate! This is a massive issue for existing code bases with loads of components that all need to be refactored to the new way of generate every time you change it, and you keep changing (and breaking!!!) it without ANY community communication! At least do the changes to generate in one fell swoop so we don't have to continually refactor all existing components! And document them in the changenotes!
elpupi commentedon May 13, 2020
@alexandertrefz is right. It would be nice a feature like Angular Schematics.
tricki commentedon Jun 12, 2020
The import was fixed in #2486
rwaskiewicz commentedon Apr 19, 2022
Hey all, I'm closing this issue, as it was fixed in #2486, as @tricki pointed out.