Support using ES modules to define scenarios #11
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on #10 I was testing out setting up scenario-tester in a non-built package (ember-cli-fastboot) and I wasn't able to get
scenario-tester list
to work because the code expected commonJS.I couldn't see any way around this other than to make sure that typescript outputs modules (so we can do dynamic imports properly) but then this means you can only use scenario-tester in an ESM environment. I've added tests to show specifics of ESM and CommonJS environments.
I'm wondering if we should just move everything to ESM or if we should do something like https://thesametech.com/how-to-build-typescript-project/ to allow us to build an ESM and CommonJS compatible output. Thoughts?
Edit: here is a PR to ember-cli-fastboot that implements scenario-tester using this PR 👍 ember-fastboot/ember-cli-fastboot#919