GithubHelp home page GithubHelp logo

Comments (5)

jkeen avatar jkeen commented on July 2, 2024 1

Great, thanks! I'll give that a whirl.

Just submitted #14 which should close this issue, and here's a try at that header overriding thing if that's a direction you think we should take.

from ember-cli-fastboot-testing.

ryanto avatar ryanto commented on July 2, 2024

Yes, I think as a default we should pass as much info from the browser into the fastboot request. That will certainly help unexpected bugs like the one you ran into yesterday.

One thing I've sort of been putting off is the ability to configure these headers/options from the test. For example, you might want to write multiple tests with different headers/cookies.

test('my fastboot app renders when a user is logged in', async function(assert) {
  await visit('/', { headers: { cookie: 'some-logged-in-user-cookie' } });
});

But I'm not sure what exactly this API should be. There's a whole bunch of options... everything from the request to how fastboot runs.

So yah... A good starting point would be exactly what you said, include all request headers. Later we can figure out what folks want to change per test. Thoughts?

from ember-cli-fastboot-testing.

jkeen avatar jkeen commented on July 2, 2024

Perfect, we're on the same page. I was thinking the same thing as far that API went. I'll get something worked up and submit that PR.

This is an entirely different topic, but another issue I'm running into related to this whole fastboot testing story is mocking some requests that happen on the fastboot side of things. Where y'all at on your thoughts surrounding the mirage + fastboot strategy? Ideally I'd like these fastboot tests to verify that data is getting loaded and rendered on the server side. Any advice for mocking one request on the fastboot side without mirage?

from ember-cli-fastboot-testing.

ryanto avatar ryanto commented on July 2, 2024

Awesome 👍

For the testing data I don't have a good answer. In the past I've used Ember CLI's express mocks for this sort of thing: https://github.com/embermap/ember-data-storefront/blob/master/server/mocks/posts.js and https://github.com/embermap/ember-data-storefront/blob/master/server/index.js. It takes a bit of playing around with to get it right.

Sam and I want to get mirage working in node... and once that happens fastboot would be able to talk to it. We need this to get our testing story right, but I think we're still a few months away from getting this working. In my mind that's the best way forward, but it doesn't exist today :)

from ember-cli-fastboot-testing.

ryanto avatar ryanto commented on July 2, 2024

Awesome, published as 0.0.6!

The header overriding looks good too!

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.