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

Add some TS component blueprint tests #20771

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Windvis
Copy link
Contributor

@Windvis Windvis commented Oct 5, 2024

While looking into #20511 I noticed there weren't any tests for the --typescript version of the blueprints.

This adds a some ts tests for the component blueprint. We can add tests for other blueprint in follow up PRs.

I included a pnpm patch for the ember-cli/ember-cli-blueprint-test-helpers package since it doesn't accept any extra cli arguments for ember new in its current state: ember-cli/ember-cli-blueprint-test-helpers#391

This also fixes a bug where ember g component foo.ts would generate .ts.hbs files since .ts wasn't normalized yet.

Partially solves: #20362

@Windvis Windvis changed the title Ts blueprint tests Add some TS component blueprint tests. Oct 5, 2024
importers:

.:
dependencies:
'@babel/core':
specifier: ^7.24.4
version: 7.24.4
version: 7.24.4([email protected])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of lock changes, but I used the pnpm version that was listed in the package.json (8.10). I guess it's possible someone else used a different version in the past?

@Windvis
Copy link
Contributor Author

Windvis commented Oct 5, 2024

Hmm, I think CI isn't using the pnpm patch. It does seem to work locally, so not sure what I did wrong. 🤔

Edit: Ah no, I forgot about the blueprint tests that mimic the scenario where .ts can't be transpiled (so the blueprints-js folder is used instead).

@Windvis Windvis force-pushed the ts-blueprint-tests branch 2 times, most recently from c992cd1 to 70fc841 Compare October 5, 2024 13:25
package.json Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
@Windvis Windvis changed the title Add some TS component blueprint tests. Add some TS component blueprint tests Oct 6, 2024
This setup can verify that the .ts blueprints are working as expected.
This fixes an issue where `.ts.ts` or `.ts.hbs` would be generated if
the user added the extension to the cli command: `ember g component
foo.ts`
"test:blueprints:js": "EMBER_TYPESCRIPT_BLUEPRINTS=false pnpm test:blueprints:js-from-ts",
"test:blueprints:js-from-ts": "mocha node-tests/blueprints/**/*-test.js",
"test:blueprints:ts": "mocha node-tests/blueprints-ts/**/*-test.js",
"test:blueprints": "npm-run-all test:blueprints:*",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this one now since we no longer use it in CI, and I don't expect anyone to run all of them like this locally either.

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

Successfully merging this pull request may close these issues.

1 participant