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

grunt not picking up jasmine test - 0 specs #25

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

grunt not picking up jasmine test - 0 specs #25

ctippur opened this issue Sep 13, 2013 · 2 comments

Comments

@ctippur
Copy link

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:

I see that the _SpecRunner.html gets created during the run time but looks like it gets deleted.
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

@davidposin
Copy link

I'm sure you figured this out by now, but just in case and to help anyone else who gets here asking the same question, the _SpecRunner.html is deleted by default. Set the options key 'keepRunner' to true to tell grunt to keep the _SpecRunner.html file alive.

@s9tpepper
Copy link
Member

Hm, the 0 failures part is weird. But I had not noticed the _SpecRunner.html file at all to be honest. I've used the task mainly to run tests with Jenkins and output junit reports. I think the 0 failures might have been due to a bug that got fixed by a recent PR to fix the task from not failing if Jasmine actually failed a test. But I'm not entirely sure.

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

No branches or pull requests

3 participants