<commit_before>import assert from 'assert'
import os from 'os'
import sync from '../../packages/wdio-sync'
import { remote } from '../../packages/webdriverio'

describe('Mocha smoke test', () => {
    let testJs = 'tests/mocha/test.js:'

    before(() => {
        if (os.platform() === 'win32') {
            testJs = testJs.split('/').join('\\')
        }
    })

    it('should return sync value', () => {
        expect(browser).toHaveTitle('Mock Page Title')
    })

    let hasRun = false
    it('should retry', function () {
        if (!hasRun) {
            hasRun = true
            assert.equal(this.wdioRetries, 0)
            throw new Error('booom!')
        }

        assert.equal(this.wdioRetries, 1)
    }, 1)

    /**
     * ToDo(Christian): remove .skip once: https://github.com/nodejs/node/issues/32851
     * is resolved. This bug is causing the test to end twice, once with a failure
     * "socket hang up" due to the bug above and the other with a pass, making the
     * test ultimatively fail as done() is being called twice. I looked into possible
     * workarounds but it seems like some sort of inconsistency between Node.js <> got <> nock
     */
    it.skip('should work fine after catching an error', () => {
        browser.clickScenario()
<commit_msg>Issue# 5521 - unskipped mocha test re-ran it several times (#5527)<commit_after>import assert from 'assert'
import os from 'os'
import sync from '../../packages/wdio-sync'
import { remote } from '../../packages/webdriverio'

describe('Mocha smoke test', () => {
    let testJs = 'tests/mocha/test.js:'

    before(() => {
        if (os.platform() === 'win32') {
            testJs = testJs.split('/').join('\\')
        }
    })

    it('should return sync value', () => {
        expect(browser).toHaveTitle('Mock Page Title')
    })

    let hasRun = false
    it('should retry', function () {
        if (!hasRun) {
            hasRun = true
            assert.equal(this.wdioRetries, 0)
            throw new Error('booom!')
        }

        assert.equal(this.wdioRetries, 1)
    }, 1)

    it('should work fine after catching an error', () => {
        browser.clickScenario()

{'fraction_non_alphanumeric': 0.1487108655616943, 'fraction_numerical': 0.010589318600368325, 'mean_word_length': 2.2924242424242425, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5768494', 'n_tokens_mistral': 675, 'n_tokens_neox': 638, 'n_words': 193}