-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
837 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/allure-mocha/test/fixtures/samples/legacy/categories.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// cjs: const { it } = require("mocha"); | ||
// cjs: const { allure } = require("allure-mocha/runtime"); | ||
// cjs: const { Status } = require("allure-js-commons"); | ||
// esm: import { it } from "mocha"; | ||
// esm: import { allure } from "allure-mocha/runtime"; | ||
// esm: import { Status } from "allure-js-commons"; | ||
|
||
it("a test run with categories", () => { | ||
allure.writeCategoriesDefinitions([ | ||
{ | ||
name: "foo", | ||
description: "bar", | ||
messageRegex: "broken", | ||
matchedStatuses: [Status.BROKEN], | ||
}, | ||
{ | ||
name: "baz", | ||
description: "qux", | ||
messageRegex: "failure", | ||
matchedStatuses: [Status.FAILED], | ||
}, | ||
]); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/description.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a description", () => { | ||
allure.description("foo"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/descriptionHtml.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a description in HTML", () => { | ||
allure.descriptionHtml("foo"); | ||
}); |
8 changes: 8 additions & 0 deletions
8
packages/allure-mocha/test/fixtures/samples/legacy/environmentInfo.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// cjs: const { it } = require("mocha"); | ||
// cjs: const { allure } = require("allure-mocha/runtime"); | ||
// esm: import { it } from "mocha"; | ||
// esm: import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test run with env info", () => { | ||
allure.writeEnvironmentInfo({ foo: "bar", baz: "qux" }); | ||
}); |
10 changes: 10 additions & 0 deletions
10
packages/allure-mocha/test/fixtures/samples/legacy/fixtures/renamed.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { beforeEach, describe, it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
describe("a suite with before", () => { | ||
beforeEach("an initial name", () => { | ||
allure.displayName("a new name"); | ||
}); | ||
|
||
it("a test affected by a renamed fixture", () => {}); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/bdd/epic.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with an epic", () => { | ||
allure.epic("foo"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/bdd/feature.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a feature", () => { | ||
allure.feature("foo"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/bdd/story.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a story", () => { | ||
allure.story("foo"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/custom.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a custom label", () => { | ||
allure.label("foo", "bar"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/layer.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a layer", () => { | ||
allure.layer("foo"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/owner.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with an owner", () => { | ||
allure.owner("foo"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/severities/blocker.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a blocker", () => { | ||
allure.severity("blocker"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/severities/critical.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a critical test", () => { | ||
allure.severity("critical"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/severities/minor.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a minor test", () => { | ||
allure.severity("minor"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/severities/normal.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a normal test", () => { | ||
allure.severity("normal"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/severities/trivial.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a trivial test", () => { | ||
allure.severity("trivial"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/suites/parentSuite.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a parent suite", () => { | ||
allure.parentSuite("foo"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/suites/subSuite.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a sub-suite", () => { | ||
allure.subSuite("foo"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/labels/suites/suite.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a suite", () => { | ||
allure.suite("foo"); | ||
}); |
7 changes: 7 additions & 0 deletions
7
packages/allure-mocha/test/fixtures/samples/legacy/labels/tags.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with tags", () => { | ||
allure.tag("foo"); | ||
allure.tag("bar"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/links/issue.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with an issue link", () => { | ||
allure.issue("baz", "https://foo.bar"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/links/namedLink.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a named link", () => { | ||
allure.link("https://foo.bar", "baz"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/links/tms.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a tms link", () => { | ||
allure.tms("baz", "https://foo.bar"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/links/urlOnlyLink.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a url only link", () => { | ||
allure.link("https://foo.bar"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/links/urlTypeLink.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a link of a custom type", () => { | ||
allure.link("https://foo.bar", "baz", "qux"); | ||
}); |
8 changes: 8 additions & 0 deletions
8
...s/allure-mocha/test/fixtures/samples/legacy/parameters/testWithExcludedParameter.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
["bar", "baz"].forEach((v) => { | ||
it("a test with an excluded parameter", () => { | ||
allure.parameter("foo", v, { excluded: true }); | ||
}); | ||
}); |
6 changes: 6 additions & 0 deletions
6
...ges/allure-mocha/test/fixtures/samples/legacy/parameters/testWithHiddenParameter.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a hidden parameter", () => { | ||
allure.parameter("foo", "bar", { mode: "hidden" }); | ||
}); |
6 changes: 6 additions & 0 deletions
6
...ges/allure-mocha/test/fixtures/samples/legacy/parameters/testWithMaskedParameter.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a masked parameter", () => { | ||
allure.parameter("foo", "bar", { mode: "masked" }); | ||
}); |
8 changes: 8 additions & 0 deletions
8
packages/allure-mocha/test/fixtures/samples/legacy/parameters/testWithParameter.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
["bar", "baz", { key: 10 }].forEach((v) => { | ||
it("a test with a parameter", () => { | ||
allure.parameter("foo", v); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
packages/allure-mocha/test/fixtures/samples/legacy/steps/brokenLogStep.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// cjs: const { it } = require("mocha"); | ||
// cjs: const { allure } = require("allure-mocha/runtime"); | ||
// cjs: const { Status } = require("allure-js-commons"); | ||
// esm: import { it } from "mocha"; | ||
// esm: import { allure } from "allure-mocha/runtime"; | ||
// esm: import { Status } from "allure-js-commons"; | ||
|
||
it("a broken log step", () => { | ||
allure.logStep("foo", Status.BROKEN); | ||
}); |
8 changes: 8 additions & 0 deletions
8
packages/allure-mocha/test/fixtures/samples/legacy/steps/brokenStep.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a broken step", () => { | ||
allure.step("foo", () => { | ||
throw new Error("foo"); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
packages/allure-mocha/test/fixtures/samples/legacy/steps/failedLogStep.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// cjs: const { it } = require("mocha"); | ||
// cjs: const { allure } = require("allure-mocha/runtime"); | ||
// cjs: const { Status } = require("allure-js-commons"); | ||
// esm: import { it } from "mocha"; | ||
// esm: import { allure } from "allure-mocha/runtime"; | ||
// esm: import { Status } from "allure-js-commons"; | ||
|
||
it("a failed log step", () => { | ||
allure.logStep("foo", Status.FAILED); | ||
}); |
9 changes: 9 additions & 0 deletions
9
packages/allure-mocha/test/fixtures/samples/legacy/steps/failedStep.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { expect } from "chai"; | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a failed step", () => { | ||
allure.step("foo", () => { | ||
expect("foo").eq("bar", "baz"); | ||
}); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/steps/lambdaStep.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a lambda step", () => { | ||
allure.step("foo", () => {}); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/steps/logStep.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a log step", () => { | ||
allure.step("foo"); | ||
}); |
10 changes: 10 additions & 0 deletions
10
packages/allure-mocha/test/fixtures/samples/legacy/steps/renamedStep.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// cjs: const { it } = require("mocha"); | ||
// cjs: const { allure } = require("allure-mocha/runtime"); | ||
// esm: import { it } from "mocha"; | ||
// esm: import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a renamed step", () => { | ||
allure.step("foo", (ctx) => { | ||
ctx.name("bar"); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
packages/allure-mocha/test/fixtures/samples/legacy/steps/skippedLogStep.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// cjs: const { it } = require("mocha"); | ||
// cjs: const { allure } = require("allure-mocha/runtime"); | ||
// cjs: const { Status } = require("allure-js-commons"); | ||
// esm: import { it } from "mocha"; | ||
// esm: import { allure } from "allure-mocha/runtime"; | ||
// esm: import { Status } from "allure-js-commons"; | ||
|
||
it("a skipped log step", () => { | ||
allure.logStep("foo", Status.SKIPPED); | ||
}); |
11 changes: 11 additions & 0 deletions
11
packages/allure-mocha/test/fixtures/samples/legacy/steps/stepReturnsPromise.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// cjs: const { it } = require("mocha"); | ||
// cjs: const { allure } = require("allure-mocha/runtime"); | ||
// esm: import { it } from "mocha"; | ||
// esm: import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a step that returns a value promise", async () => { | ||
const result = await allure.step("foo", async () => await new Promise((r) => setTimeout(() => r("bar"), 50))); | ||
if (result !== "bar") { | ||
throw new Error(`Unexpected value ${result}`); | ||
} | ||
}); |
11 changes: 11 additions & 0 deletions
11
packages/allure-mocha/test/fixtures/samples/legacy/steps/stepReturnsValue.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// cjs: const { it } = require("mocha"); | ||
// cjs: const { allure } = require("allure-mocha/runtime"); | ||
// esm: import { it } from "mocha"; | ||
// esm: import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a test with a step that returns a value", () => { | ||
const result = allure.step("foo", () => "bar"); | ||
if (result !== "bar") { | ||
throw new Error(`Unexpected value ${result}`); | ||
} | ||
}); |
8 changes: 8 additions & 0 deletions
8
packages/allure-mocha/test/fixtures/samples/legacy/steps/stepWithAttachment.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a step with an attachment", () => { | ||
allure.step("step", () => { | ||
allure.attachment("foo.txt", Buffer.from("bar"), "text/plain"); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
packages/allure-mocha/test/fixtures/samples/legacy/steps/stepWithParameter.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// cjs: const { it } = require("mocha"); | ||
// cjs: const { allure } = require("allure-mocha/runtime"); | ||
// esm: import { it } from "mocha"; | ||
// esm: import { allure } from "allure-mocha/runtime"; | ||
|
||
it("a step with a parameter", () => { | ||
allure.step("foo", (ctx) => { | ||
ctx.parameter("bar", "baz"); | ||
}); | ||
}); |
8 changes: 8 additions & 0 deletions
8
packages/allure-mocha/test/fixtures/samples/legacy/steps/twoNestedSteps.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("two nested steps", () => { | ||
allure.step("foo", () => { | ||
allure.step("bar", () => {}); | ||
}); | ||
}); |
7 changes: 7 additions & 0 deletions
7
packages/allure-mocha/test/fixtures/samples/legacy/steps/twoStepsInRow.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("two steps in a row", () => { | ||
allure.step("foo", () => {}); | ||
allure.step("bar", () => {}); | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/allure-mocha/test/fixtures/samples/legacy/testAttachment.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { it } from "mocha"; | ||
import { allure } from "allure-mocha/runtime"; | ||
|
||
it("test attachment", () => { | ||
allure.attachment("foo.txt", Buffer.from("bar"), "text/plain"); | ||
}); |
Oops, something went wrong.