Git Product home page Git Product logo

Comments (14)

topaxi avatar topaxi commented on June 24, 2024 9

Are you by any chance using ember-cli-mirage?

I noticed that the request.onload callback never got called. This might be caused by pretenderjs (even though the request was made and I had a passthrough rule in mirage/config.js).

In my codebase in tests/helpers/destroy-app.js there was a missing line server.shutdown();.

Here the full file which solved the issue for me:

tests/helpers/destroy-app.js

import Ember from 'ember';

export default function destroyApp(application) {
  Ember.run(application, 'destroy');
  server.shutdown();
}

from ember-cli-code-coverage.

rox163 avatar rox163 commented on June 24, 2024 1

I've seen this as well but only with addons that have acceptance tests. If I skip the acceptance test then the run completes and reports coverage.

from ember-cli-code-coverage.

lone-cloud avatar lone-cloud commented on June 24, 2024 1

The issue is back for me with 0.3.9 but 0.3.8 is still good

from ember-cli-code-coverage.

topaxi avatar topaxi commented on June 24, 2024

My builds stopped working with the same behaviour, it seemed to appear randomly. I guess this might be a dependency issue?

from ember-cli-code-coverage.

lone-cloud avatar lone-cloud commented on June 24, 2024

@rox163 Thank you! That was causing the freezing for me too.

from ember-cli-code-coverage.

lone-cloud avatar lone-cloud commented on June 24, 2024

That was exactly my problem too. Thank you. 😲

from ember-cli-code-coverage.

mdarmetko avatar mdarmetko commented on June 24, 2024

Still having this issue with version 0.3.9 even with the above solution. Reverting to 0.2.2 fixed it for me.

from ember-cli-code-coverage.

kategengler avatar kategengler commented on June 24, 2024

Hopefully solved by #87

from ember-cli-code-coverage.

kategengler avatar kategengler commented on June 24, 2024

#87 has been released in 0.3.10

from ember-cli-code-coverage.

ming-codes avatar ming-codes commented on June 24, 2024

Duplicates with #88?

from ember-cli-code-coverage.

lone-cloud avatar lone-cloud commented on June 24, 2024

I opened this ticket over a month before 88.
Anyways, the hanging issue is fixed for me after upgrading to 0.3.10 ( and previously having applied topaxi's fix ).

from ember-cli-code-coverage.

mdarmetko avatar mdarmetko commented on June 24, 2024

Was still seeing this in 0.3.10. I'm using mostly default generated tests with ember 2.10 and ember-cli-mirage. It must have been a problem with a mirage instance never getting shutdown and hanging around. Resolved it by adding if(server !== undefined) { server.shutdown(); } to beforeEach and afterEach in each acceptance test file. As in,

module('Acceptance: Metro', {
  beforeEach: function() {
    if(server !== undefined) { server.shutdown(); }
    application = startApp();
    originalConfirm = window.confirm;
    window.confirm = function() {
      confirmCalledWith = [].slice.call(arguments);
      return true;
    };
  },
  afterEach: function() {
    Ember.run(application, 'destroy');
    window.confirm = originalConfirm;
    confirmCalledWith = null;
    if(server !== undefined) { server.shutdown(); }
  }
});

Hope this helps someone else having the same problem.

from ember-cli-code-coverage.

isaacaskew avatar isaacaskew commented on June 24, 2024

@topaxi - that mirage server.shutdown() trick saved my ass. If you're ever in the Chicago area, your drink's on me.

from ember-cli-code-coverage.

tniezurawski avatar tniezurawski commented on June 24, 2024

I had the same problem. Because of Integration tests where I use New Testing API.

I had to close mirage server (server.shutdown()) after every Integration tests. Here is quite neat solution for folks that will strugle with this in the future:

https://gist.github.com/tniezurawski/907d0fa83a7a621146add3871d1827ca

from ember-cli-code-coverage.

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.