mirror of
https://github.com/jakejarvis/hoot.git
synced 2025-10-18 20:14:25 -04:00
Update Vitest configuration to remove jsdom environment and add environment declarations to test files
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { CreateIssueButton } from "@/components/create-issue-button";
|
import { CreateIssueButton } from "@/components/create-issue-button";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { DnsRecordList } from "@/components/domain/dns-record-list";
|
import { DnsRecordList } from "@/components/domain/dns-record-list";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { DomainReportView } from "@/components/domain/domain-report-view";
|
import { DomainReportView } from "@/components/domain/domain-report-view";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import { createElement } from "react";
|
import { createElement } from "react";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { exportDomainData } from "./export-data";
|
import { exportDomainData } from "./export-data";
|
||||||
|
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { createElement } from "react";
|
import { createElement } from "react";
|
||||||
import type { Mock } from "vitest";
|
import type { Mock } from "vitest";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen, waitFor } from "@testing-library/react";
|
import { render, screen, waitFor } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { ProviderValue } from "./provider-value";
|
import { ProviderValue } from "./provider-value";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen, waitFor } from "@testing-library/react";
|
import { render, screen, waitFor } from "@testing-library/react";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { RelativeExpiry } from "./relative-expiry";
|
import { RelativeExpiry } from "./relative-expiry";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { fireEvent, render, screen } from "@testing-library/react";
|
import { fireEvent, render, screen } from "@testing-library/react";
|
||||||
import type { Mock } from "vitest";
|
import type { Mock } from "vitest";
|
||||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { createElement } from "react";
|
import { createElement } from "react";
|
||||||
import type { Mock } from "vitest";
|
import type { Mock } from "vitest";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { CertificatesSection, equalHostname } from "./certificates-section";
|
import { CertificatesSection, equalHostname } from "./certificates-section";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { DnsRecordsSection } from "./dns-records-section";
|
import { DnsRecordsSection } from "./dns-records-section";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { HeadersSection } from "./headers-section";
|
import { HeadersSection } from "./headers-section";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { HostingEmailSection } from "./hosting-email-section";
|
import { HostingEmailSection } from "./hosting-email-section";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { formatRegistrant, RegistrationSection } from "./registration-section";
|
import { formatRegistrant, RegistrationSection } from "./registration-section";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import { createElement } from "react";
|
import { createElement } from "react";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { createElement } from "react";
|
import { createElement } from "react";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment jsdom */
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { TtlBadge } from "./ttl-badge";
|
import { TtlBadge } from "./ttl-badge";
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment node */
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { isValidDomain, normalizeDomainInput } from "./domain";
|
import { isValidDomain, normalizeDomainInput } from "./domain";
|
||||||
|
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment node */
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { formatDate, formatTtl } from "./format";
|
import { formatDate, formatTtl } from "./format";
|
||||||
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
/* @vitest-environment node */
|
/* @vitest-environment node */
|
||||||
|
|
||||||
import sharp from "sharp";
|
import sharp from "sharp";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import {
|
import {
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment node */
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import {
|
import {
|
||||||
detectCertificateAuthority,
|
detectCertificateAuthority,
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
/* @vitest-environment node */
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import {
|
import {
|
||||||
parseHtmlMeta,
|
parseHtmlMeta,
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
/* @vitest-environment node */
|
/* @vitest-environment node */
|
||||||
|
|
||||||
import type * as tls from "node:tls";
|
import type * as tls from "node:tls";
|
||||||
|
|
||||||
// Hoisted mock for node:tls to avoid ESM spy limitations
|
// Hoisted mock for node:tls to avoid ESM spy limitations
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
/* @vitest-environment node */
|
/* @vitest-environment node */
|
||||||
|
|
||||||
import type { Mock } from "vitest";
|
import type { Mock } from "vitest";
|
||||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||||
import { detectHosting } from "./hosting";
|
import { detectHosting } from "./hosting";
|
||||||
|
@@ -5,7 +5,6 @@ import { coverageConfigDefaults, defineConfig } from "vitest/config";
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [tsconfigPaths(), react()],
|
plugins: [tsconfigPaths(), react()],
|
||||||
test: {
|
test: {
|
||||||
environment: "jsdom",
|
|
||||||
setupFiles: ["./vitest.setup.ts"],
|
setupFiles: ["./vitest.setup.ts"],
|
||||||
css: true,
|
css: true,
|
||||||
globals: true,
|
globals: true,
|
||||||
|
Reference in New Issue
Block a user