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

Spec output either strange or completely missing #115

Closed
romanbloeth opened this issue Feb 10, 2014 · 4 comments
Closed

Spec output either strange or completely missing #115

romanbloeth opened this issue Feb 10, 2014 · 4 comments

Comments

@romanbloeth
Copy link

I have added a spec as first of four in a describe block. When it is the only spec in that block, I get the following output:

[..]
updateTimerDisplay
 - calls removeCountdownTimer($widget) if no seconds are remaining...     SlideshowHome
[..]

(no checkmark or cross, but a minus sign in the beginning of the line and the final line break missing, so the title of the next describe block follows in the same output line)

when I disable that spec (with xit(...)), I get this output:

[..]
updateTimerDisplay
 * calls removeCountdownTimer($widget) if no seconds are remaining
SlideshowHome
[..]

but when I enable it together with the other specs, the output of the first spec is missing completely, but it is counted in the final specs count output from the jasmine task run.

Any ideas?

@jsoverson
Copy link
Member

How are you running this? The output will differ slightly based on whether or not you are in a proper terminal or not.

@romanbloeth
Copy link
Author

I'm running it with coloured output in Terminator using the bash shell. Also, I've updated the output display in my first post a bit.

@romanbloeth
Copy link
Author

Ok, the code being executed in these cases is ./node_modules/grunt-contrib-jasmine/tasks/jasmine.js:210:

    phantomjs.on('jasmine.specStarted', function(specMetaData) {
      thisRun.executedSpecs++;
      thisRun.cleanConsole = true;
      grunt.log.write(indent(indentLevel) + '- ' + chalk.grey(specMetaData.description) + '...');
    });

That's how far I've gotten until now - will try to dig deeper into it if my time allows for it.

@romanbloeth
Copy link
Author

And I can reproduce it with this code:

Acutal JS code tested (using jquery.slides.js from http://www.slidesjs.com/):

        SlideshowHome: {
            initialize: function initialize() {
                var $slideshowContainer = $('#slideshow-teaser-home');

                if ($slideshowContainer.length) {
                    $slideshowContainer.slidesjs({
                        width: 1024,
                        height: 144,
                        effect: {
                            fade: {
                                speed: 300,
                                crossfade: true
                            }
                        },
                        play: {
                            active: false,
                            effect: 'fade',
                            interval: 5000,
                            auto: true,
                            pauseOnHover: true
                        },
                        navigation: {
                            active: false,
                            effect: "fade"
                        },
                        pagination: {
                            active: true,
                            effect: "fade"
                        }
                    });
                }
            }
        },

The spec I'm currently trying out for the above code:

            describe('SlideshowHome', function () {
                describe('initialize', function () {
                    it('invokes the slidesjs function on the slideshow container element', function () {
                        setFixtures('<div id="slideshow-teaser-home"></div>');
                        var $slideshowContainer = $('#slidshow-teaser-home');
                        spyOn($.fn, 'slidesjs');

                        Lesara.Catalog.SlideshowHome.initialize();

                        expect($.fn.slidesjs).not.toHaveBeenCalled();
                    });
                });
            });

The '$' is for jQuery, not PrototypeJS, btw.
When the spec has the ".not" in it's expect line, I the the weird output (beginning with '-', ending with three dots (...) and no line break). I I omit the ".not", I get a proper valid result output with the green checkmark. The mentioned 'weird' output is shown whenever this spec fails.

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