Skip to content

Commit

Permalink
fix linters issues
Browse files Browse the repository at this point in the history
  • Loading branch information
epszaw committed May 20, 2024
1 parent a40acff commit c86f8cf
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
4 changes: 1 addition & 3 deletions packages/allure-cucumberjs/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Before } from "@cucumber/cucumber";
import {
setGlobalTestRuntime,
} from "allure-js-commons/sdk/node";
import { setGlobalTestRuntime } from "allure-js-commons/sdk/node";
import { AllureCucumberTestRuntime } from "./runtime.js";

Before(function () {
Expand Down
6 changes: 3 additions & 3 deletions packages/allure-cucumberjs/src/reporter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { World, Formatter, IFormatterOptions, TestCaseHookDefinition, setWorldConstructor } from "@cucumber/cucumber";
import { Formatter, IFormatterOptions, TestCaseHookDefinition, World } from "@cucumber/cucumber";
import * as messages from "@cucumber/messages";
import { PickleTag, Tag, TestStepResult, TestStepResultStatus } from "@cucumber/messages";
import os from "node:os";
Expand All @@ -19,8 +19,8 @@ import {
createStepResult,
getWorstStepResultStatus,
} from "allure-js-commons/sdk/node";
import { AllureCucumberTestRuntime } from "./runtime.js";
import { AllureCucumberReporterConfig, LabelConfig, LinkConfig } from "./model.js";
import { AllureCucumberTestRuntime } from "./runtime.js";

const { ALLURE_THREAD_NAME } = process.env;

Expand Down Expand Up @@ -76,7 +76,7 @@ export default class AllureCucumberReporter extends Formatter {
// set custom Allure World for single thread mode
if (options.supportCodeLibrary.World === World) {
// @ts-ignore
options.supportCodeLibrary.World = AllureCucumberTestRuntime
options.supportCodeLibrary.World = AllureCucumberTestRuntime;
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/allure-cucumberjs/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class AllureCucumberTestRuntime extends World implements TestRuntime {
}

issue(url: string, name: string) {
this.link(url, LinkType.ISSUE, name)
this.link(url, LinkType.ISSUE, name);
}

tms(url: string, name: string) {
Expand Down Expand Up @@ -220,7 +220,7 @@ export class AllureCucumberTestRuntime extends World implements TestRuntime {

tags(...tagsList: string[]) {
this.labels(...tagsList.map((value) => ({ name: LabelName.TAG, value })));
};
}

async stepDisplayName() {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { setWorldConstructor, Given } = require("@cucumber/cucumber");
const { CucumberAllureWorld } = require("allure-cucumberjs")
const { CucumberAllureWorld } = require("allure-cucumberjs");

Given("a step", () => {});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ const { Given } = require("@cucumber/cucumber");

Given("a step", () => {});

Given("a step with runtime link", async function() {
Given("a step with runtime link", async function () {
await this.link("https://example.com", "custom", "Custom link");
});

Given("a step with runtime issue links", async function() {
Given("a step with runtime issue links", async function () {
await this.issue("https://example.com/issues/1", "Custom issue 1");
await this.issue("2", "Custom issue 2");
});

Given("a step with runtime tms links", async function() {
Given("a step with runtime tms links", async function () {
await this.tms("https://example.com/tasks/1", "Custom task 1");
await this.tms("2", "Custom task 2");
});
2 changes: 0 additions & 2 deletions packages/allure-cucumberjs/test/spec/simple.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { runCucumberInlineTest } from "../utils";
it("handles basic cases", async () => {
const { tests } = await runCucumberInlineTest(["simple"], ["simple"]);

debugger

expect(tests).toHaveLength(3);
expect(tests).toContainEqual(
expect.objectContaining({
Expand Down
8 changes: 6 additions & 2 deletions packages/allure-cucumberjs/test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { fork } from "node:child_process";
import { randomUUID } from "node:crypto";
import { copyFile, mkdir, rm, writeFile } from "node:fs/promises";
import { join, resolve as resolvePath, dirname } from "node:path";
import { dirname, join, resolve as resolvePath } from "node:path";
import { AllureResults, TestResult, TestResultContainer } from "allure-js-commons/sdk";

export const runCucumberInlineTest = async (features: string[], stepsDefs: string[], parallel: boolean = true): Promise<AllureResults> => {
export const runCucumberInlineTest = async (
features: string[],
stepsDefs: string[],
parallel: boolean = true,
): Promise<AllureResults> => {
const res: AllureResults = {
tests: [],
groups: [],
Expand Down
1 change: 0 additions & 1 deletion packages/allure-js-commons/src/TestRuntime.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as Buffer from "node:buffer";
import { env } from "node:process";
import { ContentType, Label, Link, ParameterMode, ParameterOptions } from "./model.js";

export const ALLURE_TEST_RUNTIME_KEY = "allureTestRuntime";
Expand Down

0 comments on commit c86f8cf

Please sign in to comment.