Skip to content

Commit

Permalink
fix merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Apr 22, 2024
1 parent e7eb213 commit 242ba26
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 72 deletions.
10 changes: 1 addition & 9 deletions packages/astro/src/core/app/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import type {
ComponentInstance,
ManifestData,
RouteData,
SSRManifest,
} from '../../@types/astro.js';
import type { ManifestData, RouteData, SSRManifest } from '../../@types/astro.js';
import { normalizeTheLocale } from '../../i18n/index.js';
import type { SinglePageBuiltModule } from '../build/types.js';
import {
DEFAULT_404_COMPONENT,
REROUTABLE_STATUS_CODES,
REROUTE_DIRECTIVE_HEADER,
clientAddressSymbol,
Expand All @@ -26,7 +19,6 @@ import {
prependForwardSlash,
removeTrailingForwardSlash,
} from '../path.js';
import { RedirectSinglePageBuiltModule } from '../redirects/index.js';
import { RenderContext } from '../render-context.js';
import { createAssetLink } from '../render/ssr-element.js';
import { ensure404Route } from '../routing/astro-designed-error-pages.js';
Expand Down
63 changes: 0 additions & 63 deletions packages/astro/test/reroute.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,69 +96,6 @@ describe('Build reroute', () => {
assert.equal($('h1').text(), 'Index');
});

it('the render the index page when navigating spread route /spread/[...spread] ', async () => {
const html = await fixture.readFile('/spread/hello/index.html');
const html = await fixture.fetch('/blog/salut').then((res) => res.text());
const $ = cheerioLoad(html);

assert.equal($('h1').text(), 'Index');
});

it('the render the index page when navigating dynamic route /dynamic/[id] ', async () => {
const html = await fixture.fetch('/dynamic/hello').then((res) => res.text());
const $ = cheerioLoad(html);

assert.equal($('h1').text(), 'Index');
});

it('the render the index page when navigating spread route /spread/[...spread] ', async () => {
const html = await fixture.fetch('/spread/hello').then((res) => res.text());
const $ = cheerioLoad(html);

assert.equal($('h1').text(), 'Index');
});
});

describe.only('Build reroute', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;

before(async () => {
fixture = await loadFixture({
root: './fixtures/reroute/',
});
await fixture.build();
});

it('the render the index page when navigating /reroute ', async () => {
const html = await fixture.readFile('/reroute/index.html');
const $ = cheerioLoad(html);

assert.equal($('h1').text(), 'Index');
});

it('the render the index page when navigating /blog/hello ', async () => {
const html = await fixture.readFile('/blog/hello/index.html');
const $ = cheerioLoad(html);

assert.equal($('h1').text(), 'Index');
});

it('the render the index page when navigating /blog/salut ', async () => {
const html = await fixture.readFile('/blog/salut/index.html');

const $ = cheerioLoad(html);

assert.equal($('h1').text(), 'Index');
});

it('the render the index page when navigating dynamic route /dynamic/[id] ', async () => {
const html = await fixture.readFile('/dynamic/hello/index.html');
const $ = cheerioLoad(html);

assert.equal($('h1').text(), 'Index');
});

it('the render the index page when navigating spread route /spread/[...spread] ', async () => {
const html = await fixture.readFile('/spread/hello/index.html');
const $ = cheerioLoad(html);
Expand Down

0 comments on commit 242ba26

Please sign in to comment.