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

grouping related specs with describe - merge multiple files #644

Closed
mbana opened this issue Aug 1, 2014 · 1 comment
Closed

grouping related specs with describe - merge multiple files #644

mbana opened this issue Aug 1, 2014 · 1 comment

Comments

@mbana
Copy link

mbana commented Aug 1, 2014

Hi,

I was hoping for multiple calls to the describe with the same string would make the tests appear under the same heading.

File2.js:

    describe('Load', ...);

File2.js:

    describe('Load', ...);

There will be two separate headings for 'Load'.

Thanks,

@slackersoft
Copy link
Member

Jasmine doesn't really know that two describes with the same text are definitely related, so it doesn't try to do any merging and just leaves the groups as specified by calls to describe. If you really want to do something like this, you should be able to have a single file that contains the actual describe call that calls out to functions that have all the nesting in them you want:

function section1() {
    it('does stuff', function() {
    });
}
function section2() {
    it('does other things', function() {
    });
}
describe('includes other stuff', function() {
    section1();
    section2();
});

Closing this, as I don't think we want to maintain the added complexity of merging describe calls.

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

2 participants