Comments (3)
Hey @jordanbyron! Glad to hear you're liking the addon.
I think this is something we would be interested in supporting, I have two quick questions.
-
What's the work around today? If the
rootUrl = "/my-ember-app"
, Are you able to usevisit('/my-ember-app/page1')
? Or does visit not work with any URL? -
How does
rootUrl
work with Ember's acceptance tests?
Thanks!
from ember-cli-fastboot-testing.
Hey @ryanto,
What's the work around today?
Right now I don't have one.
If the
rootUrl = "/my-ember-app"
, Are you able to usevisit('/my-ember-app/page1')
? Or does visit not work with any URL?
It does not work with fastboot tests, even if we prepend our sub directory to the visit string, as you did in your example. It appears all of the requests from fastboot-testing
are hitting the server directly at the bare root url, not the sub directory, so they are missing the ember server entirely. Here is an example from our rails log which lives at the root:
Started GET "/__cleanup-mocks"
Started POST "/__fastboot-testing"
Obviously rails does not know how to respond to those requests, and they should instead be hitting /${config.rootURL}/__fastboot-testing
.
The end result in our ember tests being:
Ember CLI FastBoot Testing: We were unable to render PATH. Is your test suite blocking or intercepting HTTP requests?
How does
rootUrl
work with Ember's acceptance tests?
Excellent question. In our acceptance tests we don't have to specify the rootURL
when we call visit
. I'm not sure what is happening under the hood, but regardless of what we have set for rootURL
it seems to work as expected.
It may be worth pointing out that depending on our environment we do have different values in our config for rootURL
, which is used by ember in the index.html
file among other places, and EmberRouter#rootURL
. I don't think those differences should matter as they are just a side effect for how our ember app is deployed, but I wanted to point them out just in case.
Hopefully that helps clarify what we are seeing. I'm happy to answer any more questions or spin up an example app if that would help illustrate what we are seeing.
from ember-cli-fastboot-testing.
Hey @jordanbyron
Sorry - this totally fell off my radar!
Thanks so much for doing all the research and writing all this up, it's super helpful!
I won't have time in the next few months to implement this, but this should be something fastboot-testing supports out of the box!
I think the best bet is for us to copy the same API that acceptance testing follows. Switching between acceptance tests and fastboot tests shouldn't require knowledge of inner workings, in fact I think visit
should pretty much be copy & pasteable :) So let's do what they're doing.
Thanks again for writing all this up, really appreciate it!
from ember-cli-fastboot-testing.
Related Issues (20)
- Does not work with path=dist HOT 5
- Allow user to access fastboot instance in fastboot-testing.js config HOT 5
- Allow user to pass functions inside the `options` parameter while calling `visit` HOT 1
- Deprecation Warning in Ember 3.9+ HOT 2
- Visit helper not returning correct content upon using `this.replaceWith` for redirection HOT 4
- FastBoot.distPath returns deleted path upon running `ember test` HOT 2
- Allow for custom host in mockServer calls HOT 2
- mockServer.get not working HOT 6
- Error messages are not escaped
- Build fails with latest Babel.js
- A future for this repo. HOT 4
- najax not present when using jQuery in v0.4/v0.5 HOT 1
- Add ability to specify response headers in mocked responses HOT 1
- Use config/fastboot.js instead of separate config/fastboot-testing.js HOT 2
- Config not working HOT 5
- [0.6.0] req.headers.origin undefined in CLI mode
- Skip outputReady in production builds HOT 4
- Cut new release v0.6.1 HOT 4
- Monorepo support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cli-fastboot-testing.