GithubHelp home page GithubHelp logo

Comments (3)

ryanto avatar ryanto commented on July 2, 2024

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.

  1. What's the work around today? If the rootUrl = "/my-ember-app", Are you able to use visit('/my-ember-app/page1')? Or does visit not work with any URL?

  2. How does rootUrl work with Ember's acceptance tests?

Thanks!

from ember-cli-fastboot-testing.

jordanbyron avatar jordanbyron commented on July 2, 2024

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 use visit('/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.

ryanto avatar ryanto commented on July 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.