forked from remix-run/remix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(remix-dev): support JSX in
.js
route files (remix-run#3059)
- Loading branch information
1 parent
9ad9ea7
commit 372ff69
Showing
5 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { test } from "@playwright/test"; | ||
|
||
import { createAppFixture, createFixture, js } from "./helpers/create-fixture"; | ||
import type { AppFixture } from "./helpers/create-fixture"; | ||
import { PlaywrightFixture } from "./helpers/playwright-fixture"; | ||
|
||
test.describe(".js route files", () => { | ||
let appFixture: AppFixture; | ||
|
||
test.beforeAll(async () => { | ||
appFixture = await createAppFixture( | ||
await createFixture({ | ||
files: { | ||
"app/routes/js.js": js` | ||
export default () => <div data-testid="route-js">Rendered with .js ext</div>; | ||
`, | ||
"app/routes/jsx.jsx": js` | ||
export default () => <div data-testid="route-jsx">Rendered with .jsx ext</div>; | ||
`, | ||
}, | ||
}) | ||
); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
await appFixture.close(); | ||
}); | ||
|
||
test("should render all .js routes", async ({ page }) => { | ||
let app = new PlaywrightFixture(appFixture, page); | ||
await app.goto("/js"); | ||
await page.waitForSelector("[data-testid='route-js']"); | ||
test.expect(await page.content()).toContain("Rendered with .js ext"); | ||
}); | ||
|
||
test("should render all .jsx routes", async ({ page }) => { | ||
let app = new PlaywrightFixture(appFixture, page); | ||
await app.goto("/jsx"); | ||
await page.waitForSelector("[data-testid='route-jsx']"); | ||
test.expect(await page.content()).toContain("Rendered with .jsx ext"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters