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

WIP: adding some basic documentation #10

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mansona
Copy link
Member

@mansona mansona commented May 29, 2023

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

Copy link

@NullVoxPopuli NullVoxPopuli left a comment

Choose a reason for hiding this comment

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

Nice! Excellent to have something written here!

```

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.

Choose a reason for hiding this comment

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

Probably want --skip-npm and --skip-git flags on that ember command

Copy link
Member Author

Choose a reason for hiding this comment

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

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 👍

Choose a reason for hiding this comment

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

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.

Choose a reason for hiding this comment

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

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 qunit from 'qunit';

const { module: Qmodule, test } = qunit;

Choose a reason for hiding this comment

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

Why do we alias these?
I don't think we need to in ESM?

Copy link
Member Author

Choose a reason for hiding this comment

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

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 👍

Copy link

@NullVoxPopuli NullVoxPopuli May 29, 2023

Choose a reason for hiding this comment

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

so in a real ESM setup you absolutely do because qunit isn't ESM

can you expand on this? I've been using module with qunit in a real ESM environment (vite) no problem.

I maybe thought that this was a browser vs node issue, but even in node, seems like it should be fine:
image

Choose a reason for hiding this comment

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

@NullVoxPopuli vite papers over a lot of incompatibilities for you so not sure if it's a good base to go off of

Copy link
Member Author

Choose a reason for hiding this comment

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

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 😂


```bash
npx qunit *-test.js

Choose a reason for hiding this comment

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

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

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.

3 participants