Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
linter compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
gcaptn committed Jan 22, 2025
1 parent c600937 commit 6bf89a6
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/environment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Hook, TestFunction, Tree } from "./nodes/mod.ts";
import { Hook, type TestFunction, Tree } from "./nodes/mod.ts";
import { Runner } from "./runner.ts";

export class Environment {
Expand Down
10 changes: 5 additions & 5 deletions src/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TestFunction } from "./nodes/mod.ts";
import type { TestFunction } from "./nodes/mod.ts";
import { Environment } from "./environment.ts";

export { expect } from "expect";
Expand All @@ -15,12 +15,12 @@ export function describe(headline: string, fn: () => void) {
* Run only this suite and skip all the other sibling test suites/cases. Will
* not skip siblings that are also registered with `.only()`.
*/
describe.only = function (headline: string, fn: () => void) {
describe.only = function (headline: string, fn: () => void): void {
env.describeOnly(headline, fn);
};

/** Skip this test suite. */
describe.skip = function (headline: string, fn: () => void) {
describe.skip = function (headline: string, fn: () => void): void {
env.describeSkip(headline, fn);
};

Expand All @@ -33,12 +33,12 @@ export function it(headline: string, fn: TestFunction) {
* Run only this test case and skip all the other sibling test suites/cases.
* Will not skip siblings that are also registered with `.only()`.
*/
it.only = function (headline: string, fn: TestFunction) {
it.only = function (headline: string, fn: TestFunction): void {
env.itOnly(headline, fn);
};

/** Skip this test case. */
it.skip = function (headline: string, fn: TestFunction) {
it.skip = function (headline: string, fn: TestFunction): void {
env.itSkip(headline, fn);
};

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/nodes_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ node.finish()

import { expect } from "expect";
import { mock } from "expect-legacy";
import { DescribeNode, RootNode } from "./nodes.ts";
import { type DescribeNode, RootNode } from "./nodes.ts";
import { addDescribeNode, addItNode } from "../test_util.ts";

Deno.test("node.skip() skips all of its children", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Hook,
ItNode,
RootNode,
TestFunction,
type TestFunction,
} from "./nodes.ts";

export class Tree {
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/tree_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ calling a hook creator adds a hook to the current parent
import { expect } from "expect";
import { mock } from "expect-legacy";
import { Tree } from "./tree.ts";
import { ItNode } from "./nodes.ts";
import type { ItNode } from "./nodes.ts";

function noop() {}

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/utilities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DescribeNode, ItNode, RootNode } from "./nodes.ts";
import { DescribeNode, ItNode, type RootNode } from "./nodes.ts";

type FindChildResult = ItNode | DescribeNode | undefined;

Expand Down
4 changes: 2 additions & 2 deletions src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import * as colors from "colors";
import {
DescribeNode,
getAncestry,
Hook,
type Hook,
ItNode,
RootNode,
type RootNode,
} from "./nodes/mod.ts";

export type TestReporter = {
Expand Down
6 changes: 3 additions & 3 deletions src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import {
findChildWithFirstCase,
findChildWithLastCase,
Hook,
ItNode,
type ItNode,
RootNode,
TestFunction,
type TestFunction,
} from "./nodes/mod.ts";
import { Reporter, TestReporter } from "./reporter.ts";
import { Reporter, type TestReporter } from "./reporter.ts";

export class Runner {
reporter: TestReporter = new Reporter();
Expand Down
8 changes: 7 additions & 1 deletion src/runner_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ Runner.runNode
import { expect } from "expect";
import { mock } from "expect-legacy";
import { Runner } from "./runner.ts";
import { Hook, ItNode, RootNode, TestFunction, Tree } from "./nodes/mod.ts";
import {
Hook,
ItNode,
RootNode,
type TestFunction,
Tree,
} from "./nodes/mod.ts";
import { SilentReporter, silentTest } from "./test_util.ts";

function makeTestRunner() {
Expand Down
9 changes: 7 additions & 2 deletions src/test_util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { TestReporter } from "./reporter.ts";
import { DescribeNode, ItNode, RootNode, TestFunction } from "./nodes/mod.ts";
import type { TestReporter } from "./reporter.ts";
import {
DescribeNode,
ItNode,
type RootNode,
type TestFunction,
} from "./nodes/mod.ts";

export class SilentReporter implements TestReporter {
getTestCaseName = () => "";
Expand Down

0 comments on commit 6bf89a6

Please sign in to comment.