Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions integration-tests/ci-visibility/mocha-flaky/flaky-fails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict'

const assert = require('assert')

describe('mocha-flaky', () => {
it('can retry failed tests', () => {
assert.strictEqual(1 + 2, 4)
})
})
14 changes: 14 additions & 0 deletions integration-tests/ci-visibility/mocha-flaky/flaky-passes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict'

const assert = require('assert')
let counter = 0

describe('mocha-flaky', () => {
it('can retry flaky tests', () => {
Comment thread
cbasitodx marked this conversation as resolved.
assert.strictEqual(++counter, 2)
})

it('will not retry passed tests', () => {
assert.ok(true)
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

const assert = require('assert')

describe('disable tests with hooks', () => {
beforeEach(() => {
// setup
})

afterEach(() => {
// teardown
})

it('can disable a test with hooks', () => {
assert.strictEqual(1 + 2, 4) // intentionally fails
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

const assert = require('assert')

describe('mocha-hooks flaky-fails', () => {
beforeEach(() => {
// setup
})

afterEach(() => {
// teardown
})

it('can retry failed tests', () => {
assert.strictEqual(1 + 2, 4) // intentionally fails
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict'

const assert = require('assert')
let counter = 0

describe('mocha-hooks flaky-passes', () => {
beforeEach(() => {
// setup
})

afterEach(() => {
// teardown
})

it('can retry flaky tests', () => {
assert.strictEqual(++counter, 2)
})

it('will not retry passed tests', () => {
assert.ok(true)
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

const assert = require('assert')

describe('mocha-hooks known', () => {
beforeEach(() => {
// setup
})

afterEach(() => {
// teardown
})

it('can report known tests', () => {
assert.ok(true)
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

const assert = require('assert')

describe('mocha-hooks new', () => {
beforeEach(() => {
// setup
})

afterEach(() => {
// teardown
})

it('can report new tests', () => {
assert.ok(true)
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict'

describe('quarantine tests with failing afterEach', () => {
afterEach(() => {
throw new Error('afterEach hook failed')
Comment thread
cbasitodx marked this conversation as resolved.
})

it('can quarantine a test whose afterEach hook fails', () => {
// test passes, but the afterEach will throw
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict'

const assert = require('assert')

describe('quarantine tests with hooks', () => {
beforeEach(() => {
// setup
})

afterEach(() => {
// teardown
})

it('can quarantine a test with hooks', () => {
assert.strictEqual(1 + 2, 4) // intentionally fails
})

it('can pass normally with hooks', () => {
assert.strictEqual(1 + 2, 3)
})
})
5 changes: 5 additions & 0 deletions integration-tests/ci-visibility/mocha-skips/skip-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict'

describe('mocha-skips', () => {
it.skip('can report skipped tests', () => {})
})
Loading
Loading