Skip to content

coverageMap is not an instance when using multiple test suites #5

@Cactusbone

Description

@Cactusbone

Using nightwatch '1.5.1' or '1.7.13', I was getting timeouts errors due to crash in afterEach (browser.globals.coverageReporter.coverageMap.merge undefined)

It seemed that coverageMap was a POJO when calling browser.collectCoverage (either during tests or during global afterEach).

to work around that, I set persist_globals to true, which did nothing, and ended up using a global beforeEach to restore the instance

        beforeEach(browser, done) {
            // fixes coverageMap not being the expected class instance
            browser.globals.coverageReporter.coverageMap = coverageReporter.coverageMap;
            done();
        },

I'm not too sure if that was expected to work out of the box, or is broken by some context, or if some version of nightwatch broke it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions