Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator tests pass erroneously? #486

Closed
kingcody opened this issue Aug 25, 2014 · 5 comments
Closed

Generator tests pass erroneously? #486

kingcody opened this issue Aug 25, 2014 · 5 comments
Labels

Comments

@kingcody
Copy link
Member

I was looking at the test for the generator, in particular the should pass jshint. All of the test pass when I run grunt test in the generator folder (generator-angular-fullstack). However when i cd test/temp && grunt jshint the task jshint:all actually fails. I'm kind of confussed being that it looks like test/test-file-creation.js checks to make sure the jshint:all task passes.

Anyone have any ideas on this one?

@kingcody
Copy link
Member Author

I see, when testing with defaultOptions there is no assertion for should pass jshint

@kingcody
Copy link
Member Author

Adding:

it('should pass jshint', function(done) {
  this.timeout(60000);
  gen.run({}, function () {
    exec('grunt jshint', function (error, stdout, stderr) {
      expect(stdout).to.contain('Running "jshint:server" (jshint) task\u001b[24m\n\n✔ No problems');
      expect(stdout).to.contain('Running "jshint:all" (jshint) task\u001b[24m\n\n✔ No problems');
      done();
    });
  });
});

to line ~80 in test/test-file-creation.js resolves this issue and exposes the jshint:all fail that should be expected currently with defaultOptions selected.

@kingcody
Copy link
Member Author

I can include this fix, along with the lint errors in #482 if others are in agreement that linting with defaultOptions should be tested.

@DaftMonk
Copy link
Member

Good catch!

@JaKXz JaKXz added the bug label Aug 25, 2014
kingcody added a commit to kingcody/generator-angular-fullstack that referenced this issue Aug 25, 2014
Changes:
- Update jshint task in `Gruntfile.js` to include `serverTest`
- Add `server/.jshintrc-spec` that extends `server/.jshintrc` with spec globals
- Use `"latedef": "nofunc"` instead of `"latedef": true` in `server/.jshintrc`
- Add assertion for `jshint` task in generator tests for `defaultOptions`
- Fix pre exsisting lint errors in `server` and `client`
- Change `getEmail()` in `client/app/account/settings/settings.controller` to use `user` arg and not `$scope.user`

Closes angular-fullstack#463, angular-fullstack#486
@kingcody
Copy link
Member Author

Closed by #482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants