Fix TS support, allowing type-checking in tests#55
Conversation
| "@glint/environment-ember-loose": "^1.4.0", | ||
| "@glint/environment-ember-template-imports": "^1.4.0", | ||
| "@glint/template": "^1.4.0", | ||
| "@ember/app-tsconfig": "^1.0.0", |
There was a problem hiding this comment.
used for the main tsconfig / test app
library tsconfig is now only for publish
Unstable switched to real alpha versions
mansona
left a comment
There was a problem hiding this comment.
This is looking very good. I'm not sure my review should be blocking because most of the comments are quite minor, I'm just starting to review things in the addon-blueprint with a finer tooth comb at the moment 🙈
| // It's important that we ensure that dist directory is empty for these tests, | ||
| // troll-y things can happen with shared dists | ||
| await fs.rm(join(addonDir, 'dist'), { recursive: true, force: true }); |
There was a problem hiding this comment.
I think we need to do a beforeEach to set up the component if we're worried about things like this no?
There was a problem hiding this comment.
Or move this kind of test into a new describe() suite with its own setup?
There was a problem hiding this comment.
it is in a beforeEach + its own describe! 🎉
There was a problem hiding this comment.
no sorry you misunderstand what I said, if we're deleting a folder in the addonDir in a beforeEach then that suggests that we should be creating the addon in the beforeEach to be safe. Does that make sense?
There was a problem hiding this comment.
It does not. That sounds like work we don't need to do (and currently don't do)
test order isn't guaranteed, and no test should assume prior work has happened (aside from addon creation and fixture copying)
We don't have any cleanep for the addon itself, or the fixture files, so anything that doesn't operate on fixtures is outside the fixture using describe. Any files we don't want, are deleted before each test, because we can't trust they're already gone for other reasons
There was a problem hiding this comment.
I still feel uncomfortable about this 🙈 but we can discuss it in a follow-up PR 👍
This reverts commit 7bc3ecf.
…ommand, and not to NPM
07abc73 to
7378a8a
Compare
Resolves: #53
Prior to this PR, tests do not have a tsconfig, and thus no ts/glint things work in tests.
At present, we get a ton of:
This PR:
Sort of based off prior explorations here: https://github.com/NullVoxPopuli/nullui/tree/main (note the config directory)