GithubHelp home page GithubHelp logo

Comments (5)

ryanto avatar ryanto commented on July 20, 2024

Thanks for the report!

Something feels off if local and CI have two different results. We've got no tests in here for redirects, so I think a first step is getting these status codes tested in this addon.

Do you mind sharing how you're doing redirects in your app?

from ember-cli-fastboot-testing.

jonnygreen avatar jonnygreen commented on July 20, 2024

Sure, the route uses the redirect hook...

// app/routes/posts/index.js
export default Route.extend({

    ...

    redirect(model) {
        this.replaceWith('posts', model.firstPostId);
    }
});

The test is then run against the posts index route...

// tests/fastboot/index-redirect-test.js
test('it redirects to the first post', async function(assert) {
    let { htmlDocument, statusCode } = await visit('/posts/');
    assert.equal(statusCode, 200); //returns 307 in Circle CI

    ...
});

Let me know if I can help more.

from ember-cli-fastboot-testing.

ryanto avatar ryanto commented on July 20, 2024

Awesome, thanks!

I did a little digging and it looks like fastboot responding with 307 for replaceWith is the correct behavior. Here's the test case in the FastBoot repo: https://github.com/ember-fastboot/ember-cli-fastboot/blob/master/test/fastboot-location-test.js#L94-L115

Just to be safe, I added some redirect tests into this addon's test suite as well: #8

If your local environment and CI are having different results you might want to confirm that both environments are running the same version of FastBoot.

If it's still causes issues for you, do you mind creating a new repo where we can see this bug in isolation? That way we can see what it will take to fix this upstream in fastboot.

from ember-cli-fastboot-testing.

ryanto avatar ryanto commented on July 20, 2024

Closing for now, but feel free to reopen!

from ember-cli-fastboot-testing.

jonnygreen avatar jonnygreen commented on July 20, 2024

Thanks Ryan

I've tried running the test suite for ember-cli-fastboot-testing locally. I now get the same redirect test failures as I was experiencing in my own app i.e. running the test locally for me actually performs the redirect and then runs the test on the resulting page:

screen shot 2018-09-05 at 11 26 09

Obviously, I'm running the same versions as specified in the package.json, so the only variable I can think remaining is node - could this be a node version issue? Locally, I'm running 8.9.1. My CI tests are running 8, though I can't discover the point version.

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.