WIP: adding some basic documentation#10
WIP: adding some basic documentation#10mansona wants to merge 2 commits intoembroider-build:mainfrom
Conversation
NullVoxPopuli
left a comment
There was a problem hiding this comment.
Nice! Excellent to have something written here!
| mkdir test-packages/test-scenarios | ||
| ``` | ||
|
|
||
| Next you need to create some scenarios. The best way to create a scenario is from a Project, and the best way to create a project is to have a base project on disk. For example, in EmberJS you can create a new project with `ember new base-project` and it will create a new empty project for you. We can use this as a starting point for our other scenarios. |
There was a problem hiding this comment.
Probably want --skip-npm and --skip-git flags on that ember command
There was a problem hiding this comment.
I did that when I personally ran the command but I didn't want to make this all about ember 🤔 there is nothing tying scenario-tester to ember and I thought that was an extra detail that we shouldn't include here. Does that make sense?
I don't feel all that strongly about this so if you (or anyone) does I'm happy to add them 👍
There was a problem hiding this comment.
it does make sense, but as is, the example instruction of ember new base-project is misleading / wrong, which is where I'm coming from.
There was a problem hiding this comment.
for the purpose of having a less frustrating experience and a working set of commands I would add them
OR provide a command to achieve the same without using the ember-cli
| import { Scenarios } from 'scenario-tester'; | ||
| import qunit from 'qunit'; | ||
|
|
||
| const { module: Qmodule, test } = qunit; |
There was a problem hiding this comment.
Why do we alias these?
I don't think we need to in ESM?
There was a problem hiding this comment.
so in a real ESM setup you absolutely do because qunit isn't ESM 😞 In typescript we have been getting away with it for a while because it's so loosey-goosey with the whole thing 🤪
I've been testing this in #11 and ember-fastboot/ember-cli-fastboot#919 and it doesn't work any other way 👍
There was a problem hiding this comment.
There was a problem hiding this comment.
@NullVoxPopuli vite papers over a lot of incompatibilities for you so not sure if it's a good base to go off of
There was a problem hiding this comment.
oh sorry I thought you were talking about something else 🤔 I thought you were just telling me to do this:
import { module as Qmodule, test } from 'qunit';
and that's what I was saying just doesn't work.
I didn't realise you were commenting on the fact that I was renaming module 🙃 The reason I did this is because I copy and pasted from... either ember-auto-import or embroider... I can't remember.
I never questioned it, but if it's not an issue I am happy to just use module directly 🤷 I assume Ed probably used it because there were a billion and a half uses of the word module in the codebase and it is easier to follow 😂
| The power in this kind of setup comes when you start adding in different dependencies that you might want to test this app with. We'll go into that a bit more in the next section. For now to run these tests we can run the following command. | ||
|
|
||
| ```bash | ||
| npx qunit *-test.js |
There was a problem hiding this comment.
I would favour package.json scripts even though npx may function
as I've seen funny things with npx in a pnpm project where npx ember failed to run spectacularly but npm script of the exact same was just fine

I started to try to use scenario-tester for ember-cli-fastboot over the weekend and thought I would start documenting my progress 👍 This is very rough but I thought I would open a WIP just to show that I was working on this