Skip to content

Commit

Permalink
Move test files to __tests__ folders
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar committed Aug 1, 2024
1 parent f862406 commit f9586a0
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/root.test.tsx → app/__tests__/root.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "vitest-dom/extend-expect";
import { render, waitFor, screen } from "@testing-library/react";
import { createRemixStub } from "@remix-run/testing";

import Root from "./root";
import Root from "../root";

describe("Root", () => {
beforeAll(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Mock, describe, expect, test, vi, beforeEach } from "vitest";
import httpMocks from "node-mocks-http";

import { collectRequestHandler } from "./collect";
import { collectRequestHandler } from "../collect";

const defaultRequestParams = generateRequestParams({
"user-agent":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
beforeAll,
} from "vitest";

import { AnalyticsEngineAPI, intervalToSql } from "./query";
import { AnalyticsEngineAPI, intervalToSql } from "../query";

function createFetchResponse<T>(data: T) {
return {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/utils.test.ts → app/lib/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getFiltersFromSearchParams } from "./utils";
import { getFiltersFromSearchParams } from "../utils";
import { describe, test, expect } from "vitest";

// test this getfiltersfromsearchparams function
Expand Down
2 changes: 1 addition & 1 deletion app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const loader = ({ context, request }: LoaderFunctionArgs) => {
});
};

export const Layout = ({ children }: { children: React.ReactNode }) => {
export const Layout = ({ children = [] }: { children: React.ReactNode }) => {
const data = useRouteLoaderData<typeof loader>("root") ?? {
version: "unknown",
origin: "counterscale.dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "vitest-dom/extend-expect";
import { createRemixStub } from "@remix-run/testing";
import { render, screen } from "@testing-library/react";

import Index from "./_index";
import Index from "../_index";

describe("Index route", () => {
test("renders index route", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import "vitest-dom/extend-expect";
import { createRemixStub } from "@remix-run/testing";
import { render, screen, waitFor } from "@testing-library/react";

import Dashboard, { loader } from "./dashboard";
import Dashboard, { loader } from "../dashboard";
import { AnalyticsEngineAPI } from "~/analytics/query";

function createFetchResponse<T>(data: T) {
Expand Down

0 comments on commit f9586a0

Please sign in to comment.