Skip to content

Commit

Permalink
Merge branch 'dev' into markdalgleish/cache-postcss-side-effect-imports
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed Jun 14, 2023
2 parents adc7608 + 0ab3e9a commit 59cc10f
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 10 deletions.
7 changes: 7 additions & 0 deletions integration/bug-report-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ let appFixture: AppFixture;
// ```
////////////////////////////////////////////////////////////////////////////////

test.beforeEach(async ({ context }) => {
await context.route(/_data/, async (route) => {
await new Promise((resolve) => setTimeout(resolve, 50));
route.continue();
});
});

test.beforeAll(async () => {
fixture = await createFixture({
config: {
Expand Down
7 changes: 7 additions & 0 deletions integration/catch-boundary-data-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ let HAS_BOUNDARY_NESTED_LOADER = "/yes/loader-self-boundary" as const;
let ROOT_DATA = "root data";
let LAYOUT_DATA = "root data";

test.beforeEach(async ({ context }) => {
await context.route(/_data/, async (route) => {
await new Promise((resolve) => setTimeout(resolve, 50));
route.continue();
});
});

test.beforeAll(async () => {
fixture = await createFixture({
config: {
Expand Down
7 changes: 7 additions & 0 deletions integration/catch-boundary-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ test.describe("CatchBoundary", () => {

let NOT_FOUND_HREF = "/not/found";

test.beforeEach(async ({ context }) => {
await context.route(/_data/, async (route) => {
await new Promise((resolve) => setTimeout(resolve, 50));
route.continue();
});
});

test.beforeAll(async () => {
fixture = await createFixture({
config: {
Expand Down
7 changes: 7 additions & 0 deletions integration/defer-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ declare global {
};
}

test.beforeEach(async ({ context }) => {
await context.route(/_data/, async (route) => {
await new Promise((resolve) => setTimeout(resolve, 50));
route.continue();
});
});

test.describe("non-aborted", () => {
let fixture: Fixture;
let appFixture: AppFixture;
Expand Down
7 changes: 7 additions & 0 deletions integration/error-boundary-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ test.describe("ErrorBoundary", () => {
// packages/remix-react/errorBoundaries.tsx
let INTERNAL_ERROR_BOUNDARY_HEADING = "Application Error";

test.beforeEach(async ({ context }) => {
await context.route(/_data/, async (route) => {
await new Promise((resolve) => setTimeout(resolve, 50));
route.continue();
});
});

test.beforeAll(async () => {
_consoleError = console.error;
console.error = () => {};
Expand Down
7 changes: 7 additions & 0 deletions integration/fetcher-state-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ test.describe("fetcher states", () => {
let fixture: Fixture;
let appFixture: AppFixture;

test.beforeEach(async ({ context }) => {
await context.route(/_data/, async (route) => {
await new Promise((resolve) => setTimeout(resolve, 50));
route.continue();
});
});

test.beforeAll(async () => {
fixture = await createFixture({
config: {
Expand Down
7 changes: 7 additions & 0 deletions integration/form-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ test.describe("Forms", () => {
let SPLAT_ROUTE_PARENT_ACTION = "splat-route-parent";
let SPLAT_ROUTE_TOO_MANY_DOTS_ACTION = "splat-route-too-many-dots";

test.beforeEach(async ({ context }) => {
await context.route(/_data/, async (route) => {
await new Promise((resolve) => setTimeout(resolve, 50));
route.continue();
});
});

test.beforeAll(async () => {
fixture = await createFixture({
config: {
Expand Down
10 changes: 5 additions & 5 deletions integration/hmr-log-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ test("HMR", async ({ page, browserName }) => {
if (dev.exitCode) throw Error("Dev server exited early");
return /✅ app ready: /.test(devStdout());
},
{ timeoutMs: 10_000 }
{ timeoutMs: HMR_TIMEOUT_MS }
);

await page.goto(`http://localhost:${appPort}`, {
Expand Down Expand Up @@ -369,7 +369,7 @@ test("HMR", async ({ page, browserName }) => {
}
`;
fs.writeFileSync(indexPath, withLoader1);
await expect.poll(() => dataRequests).toBe(1);
await expect.poll(() => dataRequests, { timeout: HMR_TIMEOUT_MS }).toBe(1);
await page.waitForLoadState("networkidle");

await page.getByText("Hello, world").waitFor({ timeout: HMR_TIMEOUT_MS });
Expand Down Expand Up @@ -399,7 +399,7 @@ test("HMR", async ({ page, browserName }) => {
}
`;
fs.writeFileSync(indexPath, withLoader2);
await expect.poll(() => dataRequests).toBe(2);
await expect.poll(() => dataRequests, { timeout: HMR_TIMEOUT_MS }).toBe(2);
await page.waitForLoadState("networkidle");

await page.getByText("Hello, planet").waitFor({ timeout: HMR_TIMEOUT_MS });
Expand Down Expand Up @@ -465,11 +465,11 @@ whatsup
<Component/>
`;
fs.writeFileSync(mdxPath, mdx);
await expect.poll(() => dataRequests).toBe(4);
await expect.poll(() => dataRequests, { timeout: HMR_TIMEOUT_MS }).toBe(4);
await page.waitForSelector(`#hot`);

fs.writeFileSync(mdxPath, originalMdx);
await expect.poll(() => dataRequests).toBe(5);
await expect.poll(() => dataRequests, { timeout: HMR_TIMEOUT_MS }).toBe(5);
await page.waitForSelector(`#crazy`);

// dev server doesn't crash when rebuild fails
Expand Down
10 changes: 5 additions & 5 deletions integration/hmr-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ test("HMR", async ({ page, browserName }) => {
if (dev.exitCode) throw Error("Dev server exited early");
return /✅ app ready: /.test(devStdout());
},
{ timeoutMs: 10_000 }
{ timeoutMs: HMR_TIMEOUT_MS }
);

await page.goto(`http://localhost:${appPort}`, {
Expand Down Expand Up @@ -436,7 +436,7 @@ test("HMR", async ({ page, browserName }) => {
}
`;
fs.writeFileSync(indexPath, withLoader1);
await expect.poll(() => dataRequests).toBe(1);
await expect.poll(() => dataRequests, { timeout: HMR_TIMEOUT_MS }).toBe(1);
await page.waitForLoadState("networkidle");

await page.getByText("Hello, world").waitFor({ timeout: HMR_TIMEOUT_MS });
Expand Down Expand Up @@ -465,7 +465,7 @@ test("HMR", async ({ page, browserName }) => {
`;
fs.writeFileSync(indexPath, withLoader2);

await expect.poll(() => dataRequests).toBe(2);
await expect.poll(() => dataRequests, { timeout: HMR_TIMEOUT_MS }).toBe(2);

await page.waitForLoadState("networkidle");

Expand Down Expand Up @@ -532,11 +532,11 @@ whatsup
<Component/>
`;
fs.writeFileSync(mdxPath, mdx);
await expect.poll(() => dataRequests).toBe(4);
await expect.poll(() => dataRequests, { timeout: HMR_TIMEOUT_MS }).toBe(4);
await page.waitForSelector(`#hot`);

fs.writeFileSync(mdxPath, originalMdx);
await expect.poll(() => dataRequests).toBe(5);
await expect.poll(() => dataRequests, { timeout: HMR_TIMEOUT_MS }).toBe(5);
await page.waitForSelector(`#crazy`);

// dev server doesn't crash when rebuild fails
Expand Down
7 changes: 7 additions & 0 deletions integration/navigation-state-v2-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ test.describe("navigation states", () => {
let fixture: Fixture;
let appFixture: AppFixture;

test.beforeEach(async ({ context }) => {
await context.route(/_data/, async (route) => {
await new Promise((resolve) => setTimeout(resolve, 50));
route.continue();
});
});

test.beforeAll(async () => {
fixture = await createFixture({
config: {
Expand Down
7 changes: 7 additions & 0 deletions integration/transition-state-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ test.describe("rendering", () => {
let fixture: Fixture;
let appFixture: AppFixture;

test.beforeEach(async ({ context }) => {
await context.route(/_data/, async (route) => {
await new Promise((resolve) => setTimeout(resolve, 50));
route.continue();
});
});

test.beforeAll(async () => {
fixture = await createFixture({
config: {
Expand Down

0 comments on commit 59cc10f

Please sign in to comment.