Skip to content

Commit

Permalink
remove unstable_ prefix from createRemixStub
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds authored and ryanflorence committed Oct 11, 2023
1 parent aacd70a commit 3995048
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
22 changes: 11 additions & 11 deletions packages/remix-react/__tests__/integration/meta-test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meta, Outlet } from "@remix-run/react";
import { unstable_createRemixStub } from "@remix-run/testing";
import { createRemixStub } from "@remix-run/testing";
import { prettyDOM, render, screen } from "@testing-library/react";
import user from "@testing-library/user-event";
import * as React from "react";
Expand All @@ -9,7 +9,7 @@ const getHtml = (c: HTMLElement) =>

describe("meta", () => {
it("no meta export renders meta from nearest route meta in the tree", () => {
let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
id: "root",
path: "/",
Expand Down Expand Up @@ -66,7 +66,7 @@ describe("meta", () => {
});

it("empty meta array does not render a tag", () => {
let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
path: "/",
meta: () => [],
Expand All @@ -93,7 +93,7 @@ describe("meta", () => {
});

it("meta from `matches` renders meta tags", () => {
let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
id: "root",
path: "/",
Expand Down Expand Up @@ -141,7 +141,7 @@ describe("meta", () => {
});

it("{ charSet } adds a <meta charset='utf-8' />", () => {
let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
path: "/",
meta: () => [{ charSet: "utf-8" }],
Expand All @@ -161,7 +161,7 @@ describe("meta", () => {
});

it("{ title } adds a <title />", () => {
let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
path: "/",
meta: () => [{ title: "Document Title" }],
Expand All @@ -181,7 +181,7 @@ describe("meta", () => {
});

it("{ property: 'og:*', content: '*' } adds a <meta property='og:*' />", () => {
let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
path: "/",
meta: () => [
Expand Down Expand Up @@ -221,7 +221,7 @@ describe("meta", () => {
email: ["[email protected]", "[email protected]"],
};

let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
path: "/",
meta: () => [
Expand All @@ -244,7 +244,7 @@ describe("meta", () => {
});

it("{ tagName: 'link' } adds a <link />", () => {
let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
path: "/",
meta: () => [
Expand All @@ -270,7 +270,7 @@ describe("meta", () => {
});

it("does not mutate meta when using tagName", async () => {
let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
path: "/",
meta: ({ data }) => data?.meta,
Expand Down Expand Up @@ -329,7 +329,7 @@ describe("meta", () => {
});

it("loader errors are passed to meta", () => {
let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
path: "/",
Component() {
Expand Down
14 changes: 7 additions & 7 deletions packages/remix-testing/__tests__/stub-test.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from "react";
import { render, screen } from "@testing-library/react";
import { unstable_createRemixStub } from "@remix-run/testing";
import { createRemixStub } from "@remix-run/testing";
import { Outlet, useLoaderData, useMatches } from "@remix-run/react";
import type { DataFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";

test("renders a route", () => {
let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
path: "/",
Component: () => <div>HOME</div>,
Expand All @@ -19,7 +19,7 @@ test("renders a route", () => {
});

test("renders a nested route", () => {
let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
Component() {
return (
Expand Down Expand Up @@ -50,7 +50,7 @@ test("loaders work", async () => {
return <pre data-testid="data">Message: {data.message}</pre>;
}

let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
path: "/",
index: true,
Expand All @@ -73,7 +73,7 @@ test("can pass a predefined loader", () => {
return json({ hi: "there" });
}

unstable_createRemixStub([
createRemixStub([
{
path: "/example",
loader,
Expand All @@ -97,7 +97,7 @@ test("can pass context values", async () => {
return <pre data-testid="hello">Context: {data.context}</pre>;
}

let RemixStub = unstable_createRemixStub(
let RemixStub = createRemixStub(
[
{
path: "/",
Expand Down Expand Up @@ -141,7 +141,7 @@ test("all routes have ids", () => {
);
}

let RemixStub = unstable_createRemixStub([
let RemixStub = createRemixStub([
{
Component() {
return (
Expand Down

0 comments on commit 3995048

Please sign in to comment.