Skip to content

Generated mocha.global.js assumes Express will start before unit tests complete #2440

Open
@nstuyvesant

Description

@nstuyvesant
  • I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.
Item Version
generator-angular-fullstack 4.1.1
Node 6.9.2
npm 4.0.5
Operating System OS X 10
Item Answer
Transpiler Babel
Markup Pug
CSS SCSS
Router ui-router
Client Tests Mocha
DB SQL
Auth N

The generated mocha.global.js:

import app from './';

after(function(done) {
  app.angularFullstack.on('close', () => done());
  app.angularFullstack.close();
});

seems to assume that Express started before the unit tests invoked by the Gulp task "mocha:unit" finish. In my case, the tests finished too early so I got:

  1)  "after all" hook:
     TypeError: Cannot read property 'on' of undefined
    at Context.<anonymous> (mocha.global.js:9:10)

The function startServer in app.js didn't complete in time so app.angularFullstack was undefined.

I worked around it but was wondering if anyone else ran into this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions