ember-fastboot / fastboot

FastBoot is a library for rendering Ember.js applications in Node.js.
http://ember-fastboot.com/
158 stars 71 forks source link

Changing the FastBoot runtime environment #218

Open ryanto opened 5 years ago

ryanto commented 5 years ago

I've got a question about how to best load an Ember application built from Ember CLI into FastBoot for ember-cli-fastboot-testing

I have an Ember application that's built using ember-cli, so it's build time environment is development. When I load that dist path into new FastBoot() it uses the the application's config environment of development, which makes sense!

However, I'm wondering if I can take that same build and load it into FastBoot with a run time environment of test. I guess this question boils down to: Do I have the ability to tell FastBoot to use a different run time environment + config from what the app was built with?

What I'm trying to accomplish: I want fastboot-testing to piggy back off of the dist built by ember-cli-fastboot, but when it loads that dist I want it to use a runtime env of test.

jkeen commented 4 years ago

Came here from stumbling onto this problem after getting test failures with ember-cli-fastboot-testing when running tests from localhost:4200/tests. It'd be great if we could do this ^

viniciussbs commented 4 years ago

Same here. I have some logs that run on FastBoot only for test env and they don't run when I test with localhost:4200/tests.

xg-wang commented 3 years ago

I think ember test and ember build both accept --envrironment where you can specify development vs test https://cli.emberjs.com/release/advanced-use/cli-commands-reference/#embertest