grunt not picking up jasmine test - 0 specs #260

Open
ctippur opened this Issue Sep 13, 2013 · 2 comments

Comments

Projects
None yet
2 participants

ctippur commented Sep 13, 2013

Hello -

I am not sure if I am doing it right but when I run "grunt jasmine:test" I get ..

Running "jasmine:test" (jasmine) task
Testing jasmine specs via phantom

0 specs in 0.058s.

0 failures

Here is the snippet of the specs file

    jasmine : {
        test: {
            src : ['public/javascripts/**/*.js'],
            options : {
                specs : 'spec/client/**/*.js'
                , vendor: [
                      'public/vendor/jquery-2.0.2.min.js'
                    , 'public/vendor/jasmine-jquery.js'
                    , 'public/vendor/dust-core-1.2.3.min.js'
                    , 'node_modules/requirejs/require.js'
                    , 'vendor/bootstrap/js/bootstrap.min.js'
                ]
                , junit: {
                    path: "./build/reports/jasmine/"
                    , consolidate: true
                }
                , template: require('grunt-template-jasmine-istanbul')
                , templateOptions: {
                    coverage: 'public/coverage/client/coverage.json'
                    , report:   'public/coverage/client'
                }
            }
        }
    },

Here are the contents of spec file ..

$ cat spec/client/loginfb1Spec.js

require(['request'], function(request){
describe('HTTP request', function () {
it('responds with an "Example" page', function (done) {
request('http://localhost:3000', function (err, response, body) {
runs(function () {
expect(err).toBeNull();
expect(response.statusCode).toEqual(200);
expect(body).toContain('login-with-facebook.png');
expect(body).toContain('XX-with-facebook.png');
});
done();
});
});
});
});

Couple of observations:

  1. I see that the _SpecRunner.html gets created during the run time but looks like it gets deleted.
  2. If my intentionally make a mistake on the spec file, it seem to pick that up and error out. Does this means that the spec file is being considered but not processed when it is right?
  • Shekar
Contributor

tebriel commented Sep 13, 2013

if you npm -g jasmine-node and then run jasmine-node spec/client/loginfb1Spec.js what is the result? I didn't write grunt-jasmine-node so I'm not too familiar with it.

ctippur commented Sep 13, 2013

Thank you! I will reach out the author of grunt-jasmine-node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment