webdriverio/wdio-mocha-framework

View on GitHub
test/fixtures/tests.only.spec.js

Summary

Maintainability
A
2 hrs
Test Coverage
global.mochaExtra = {}

describe('dummy test', () => {
    it.skip('sample test pending', () => {
        const start = new Date().getTime()
        browser.pause()
        global.mochaExtra.itskip = new Date().getTime() - start
    })

    it.only('should only run this', () => { // eslint-disable-line mocha/no-exclusive-tests
        const start = new Date().getTime()
        browser.pause()
        global.mochaExtra.itonly = new Date().getTime() - start
    })

    it.only('should skip within spec', function () { // eslint-disable-line mocha/no-exclusive-tests
        this.skip()
        throw new Error('ignore me')
    })

    it.only('should skip within async spec', function async () { // eslint-disable-line mocha/no-exclusive-tests
        return browser.command().then(() => {
            this.skip()
            throw new Error('ignore me')
        })
    })

    it('should not run this', () => {
        const start = new Date().getTime()
        browser.pause()
        global.mochaExtra.it = new Date().getTime() - start
    })
})