Skip to content

Commit

Permalink
test: remove flatRoutesWarning and v2_routeConvention future flag
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <logan@mcan.sh>
  • Loading branch information
mcansh committed Mar 22, 2023
1 parent c02f9a2 commit 9bbc4ea
Show file tree
Hide file tree
Showing 56 changed files with 37 additions and 153 deletions.
1 change: 0 additions & 1 deletion integration/abort-signal-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ let appFixture: AppFixture;

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/routes/_index.jsx": js`
import { json } from "@remix-run/node";
Expand Down
3 changes: 0 additions & 3 deletions integration/action-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ test.describe("actions", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
files: {
"app/routes/urlencoded.jsx": js`
import { Form, useActionData } from "@remix-run/react";
Expand Down
1 change: 0 additions & 1 deletion integration/bug-report-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ let appFixture: AppFixture;

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
////////////////////////////////////////////////////////////////////////////
// 💿 Next, add files to this object, just like files in a real app,
// `createFixture` will make an app and run your tests against it.
Expand Down
3 changes: 0 additions & 3 deletions integration/catch-boundary-data-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ let LAYOUT_DATA = "root data";

test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
files: {
"app/root.jsx": js`
import { json } from "@remix-run/node";
Expand Down
3 changes: 0 additions & 3 deletions integration/catch-boundary-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ test.describe("CatchBoundary", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
files: {
"app/root.jsx": js`
import { json } from "@remix-run/node";
Expand Down
1 change: 0 additions & 1 deletion integration/cf-compiler-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ test.describe("cloudflare compiler", () => {

test.beforeAll(async () => {
projectDir = await createFixtureProject({
future: { v2_routeConvention: true },
setup: "cloudflare",
template: "cf-template",
files: {
Expand Down
5 changes: 1 addition & 4 deletions integration/compiler-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ test.describe("compiler", () => {
"remix.config.js": js`
let { getDependenciesToBundle } = require("@remix-run/dev");
module.exports = {
future: {
v2_routeConvention: true,
},
serverDependenciesToBundle: [
"esm-only-pkg",
"esm-only-single-export",
Expand Down Expand Up @@ -329,7 +327,6 @@ test.describe("compiler", () => {

await expect(() =>
createFixtureProject({
future: { v2_routeConvention: true },
buildStdio,
files: {
"app/routes/_index.jsx": js`
Expand Down
1 change: 0 additions & 1 deletion integration/css-modules-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ test.describe("CSS Modules", () => {
test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
// Enable all CSS future flags to
// ensure features don't clash
unstable_cssSideEffectImports: true,
Expand Down
1 change: 0 additions & 1 deletion integration/css-side-effect-imports-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ test.describe("CSS side-effect imports", () => {
unstable_postcss: true,
unstable_tailwind: true,
unstable_vanillaExtract: true,
v2_routeConvention: true,
},
};
`,
Expand Down
1 change: 0 additions & 1 deletion integration/custom-entry-server-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ let appFixture: AppFixture;

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/entry.server.jsx": js`
import * as React from "react";
Expand Down
1 change: 0 additions & 1 deletion integration/defer-loader-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ let appFixture: AppFixture;

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/routes/_index.jsx": js`
import { useLoaderData, Link } from "@remix-run/react";
Expand Down
5 changes: 1 addition & 4 deletions integration/defer-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ test.describe("non-aborted", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
future: {},
files: {
"app/components/counter.tsx": js`
import { useState } from "react";
Expand Down Expand Up @@ -939,7 +937,6 @@ test.describe("aborted", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
////////////////////////////////////////////////////////////////////////////
// 💿 Next, add files to this object, just like files in a real app,
// `createFixture` will make an app and run your tests against it.
Expand Down
1 change: 0 additions & 1 deletion integration/deno-compiler-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const searchFiles = async (pattern: string | RegExp, files: string[]) => {

test.beforeAll(async () => {
projectDir = await createFixtureProject({
future: { v2_routeConvention: true },
template: "deno-template",
files: {
"package.json": json({
Expand Down
2 changes: 0 additions & 2 deletions integration/deterministic-build-output-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ test("builds deterministically under different paths", async () => {
unstable_cssSideEffectImports: true,
unstable_postcss: true,
unstable_vanillaExtract: true,
v2_routeConvention: true,
},
files: {
"app/routes/_index.mdx": "# hello world",
Expand Down Expand Up @@ -120,7 +119,6 @@ test("builds Vanilla Extract files deterministically under different paths with
let init: FixtureInit = {
future: {
unstable_vanillaExtract: { cache: true },
v2_routeConvention: true,
},
files: {
"app/routes/foo.tsx": js`
Expand Down
18 changes: 0 additions & 18 deletions integration/error-boundary-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ test.describe("ErrorBoundary", () => {
_consoleError = console.error;
console.error = () => {};
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
files: {
"app/root.jsx": js`
import { Links, Meta, Outlet, Scripts } from "@remix-run/react";
Expand Down Expand Up @@ -494,9 +491,6 @@ test.describe("ErrorBoundary", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
files: {
"app/root.jsx": js`
import { Links, Meta, Outlet, Scripts } from "@remix-run/react";
Expand Down Expand Up @@ -662,9 +656,6 @@ test.describe("loaderData in ErrorBoundary", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
files: {
"app/root.jsx": js`
import { Links, Meta, Outlet, Scripts } from "@remix-run/react";
Expand Down Expand Up @@ -1012,9 +1003,6 @@ test.describe("Default ErrorBoundary", () => {
test.describe("When the root route does not have a boundary", () => {
test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
files: getFiles({ includeRootErrorBoundary: false }),
});
appFixture = await createAppFixture(fixture, ServerMode.Development);
Expand Down Expand Up @@ -1083,9 +1071,6 @@ test.describe("Default ErrorBoundary", () => {
test.describe("When the root route has a boundary", () => {
test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
files: getFiles({ includeRootErrorBoundary: true }),
});
appFixture = await createAppFixture(fixture, ServerMode.Development);
Expand Down Expand Up @@ -1149,9 +1134,6 @@ test.describe("Default ErrorBoundary", () => {
test.describe("When the root route has a boundary but it also throws 😦", () => {
test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
files: getFiles({
includeRootErrorBoundary: true,
rootErrorBoundaryThrows: true,
Expand Down
3 changes: 0 additions & 3 deletions integration/error-boundary-v2-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ test.describe("V2 Singular ErrorBoundary (future.v2_errorBoundary)", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
files: {
"app/root.jsx": js`
import { Links, Meta, Outlet, Scripts } from "@remix-run/react";
Expand Down
1 change: 0 additions & 1 deletion integration/error-data-request-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ test.describe("ErrorBoundary", () => {
};

fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/root.jsx": js`
import { Links, Meta, Outlet, Scripts } from "@remix-run/react";
Expand Down
1 change: 0 additions & 1 deletion integration/esm-only-warning-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test.beforeAll(async () => {

await createFixtureProject({
buildStdio,
future: { v2_routeConvention: true },
files: {
"package.json": json({
name: "remix-integration-9v4bpv66vd",
Expand Down
1 change: 0 additions & 1 deletion integration/fetcher-layout-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ let appFixture: AppFixture;

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/routes/layout-action.jsx": js`
import { json } from "@remix-run/node";
Expand Down
1 change: 0 additions & 1 deletion integration/fetcher-state-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ test.describe("fetcher states", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/root.jsx": js`
import { useMemo, useRef } from "react";
Expand Down
1 change: 0 additions & 1 deletion integration/fetcher-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ test.describe("useFetcher", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/routes/resource-route-action-only.ts": js`
import { json } from "@remix-run/node";
Expand Down
10 changes: 1 addition & 9 deletions integration/flat-routes-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import { PlaywrightFixture } from "./helpers/playwright-fixture";
import type { Fixture, AppFixture } from "./helpers/create-fixture";
import { createFixtureProject } from "./helpers/create-fixture";
import { createAppFixture, createFixture, js } from "./helpers/create-fixture";
import { flatRoutesWarning } from "../packages/remix-dev/config";

let fixture: Fixture;
let appFixture: AppFixture;

test.describe("flat routes", () => {
test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/root.jsx": js`
import { Links, Meta, Outlet, Scripts } from "@remix-run/react";
Expand Down Expand Up @@ -162,7 +160,7 @@ test.describe("warns when v1 routesConvention is used", () => {
console.error = () => {};
await createFixtureProject({
buildStdio,
future: { v2_routeConvention: false },

files: {
"routes/index.tsx": js`
export default function () {
Expand All @@ -187,11 +185,6 @@ test.describe("warns when v1 routesConvention is used", () => {
console.warn = originalConsoleWarn;
console.error = originalConsoleError;
});

test("warns about conflicting routes", () => {
console.log(buildOutput);
expect(buildOutput).toContain(flatRoutesWarning);
});
});

test.describe("emits warnings for route conflicts", async () => {
Expand All @@ -208,7 +201,6 @@ test.describe("emits warnings for route conflicts", async () => {
console.error = () => {};
await createFixtureProject({
buildStdio,
future: { v2_routeConvention: true },
files: {
"routes/_dashboard._index.tsx": js`
export default function () {
Expand Down
1 change: 0 additions & 1 deletion integration/form-data-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ let fixture: Fixture;

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/routes/_index.jsx": js`
import { json } from "@remix-run/node";
Expand Down
1 change: 0 additions & 1 deletion integration/form-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ test.describe("Forms", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/routes/get-submission.jsx": js`
import { useLoaderData, Form } from "@remix-run/react";
Expand Down
2 changes: 0 additions & 2 deletions integration/headers-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ test.describe("headers export", () => {

test.beforeAll(async () => {
appFixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/root.jsx": js`
import { json } from "@remix-run/node";
Expand Down Expand Up @@ -100,7 +99,6 @@ test.describe("headers export", () => {
let HEADER_VALUE = "SUCCESS";

let fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/root.jsx": js`
import { Links, Meta, Outlet, Scripts } from "@remix-run/react";
Expand Down
1 change: 0 additions & 1 deletion integration/hmr-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ let fixture = (options: { port: number; appServerPort: number }) => ({
appServerPort: options.appServerPort,
},
unstable_tailwind: true,
v2_routeConvention: true,
},
files: {
"package.json": json({
Expand Down
1 change: 0 additions & 1 deletion integration/hook-useSubmit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test.describe("`useSubmit()` returned function", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/routes/_index.jsx": js`
import { useLoaderData, useSubmit } from "@remix-run/react";
Expand Down
3 changes: 0 additions & 3 deletions integration/js-routes-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ test.describe(".js route files", () => {
test.beforeAll(async () => {
appFixture = await createAppFixture(
await createFixture({
future: {
v2_routeConvention: true,
},
files: {
"app/routes/js.js": js`
export default () => <div data-testid="route-js">Rendered with .js ext</div>;
Expand Down
3 changes: 0 additions & 3 deletions integration/layout-route-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ test.describe("pathless layout routes", () => {
test.beforeAll(async () => {
appFixture = await createAppFixture(
await createFixture({
future: {
v2_routeConvention: true,
},
files: {
"app/routes/_layout.jsx": js`
import { Outlet } from "@remix-run/react";
Expand Down
3 changes: 0 additions & 3 deletions integration/link-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ test.describe("route module link export", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: {
v2_routeConvention: true,
},
files: {
"app/favicon.ico": js``,

Expand Down
4 changes: 0 additions & 4 deletions integration/loader-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ test.describe("loader", () => {

test.beforeAll(async () => {
fixture = await createFixture({
future: { v2_routeConvention: true },
files: {
"app/root.jsx": js`
import { json } from "@remix-run/node";
Expand Down Expand Up @@ -76,9 +75,6 @@ test.describe("loader in an app", () => {
test.beforeAll(async () => {
appFixture = await createAppFixture(
await createFixture({
future: {
v2_routeConvention: true,
},
files: {
"app/root.jsx": js`
import { Outlet } from '@remix-run/react'
Expand Down
Loading

0 comments on commit 9bbc4ea

Please sign in to comment.