Skip to content

chore: enable server tests #2176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions test/templates/server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,15 @@ beforeAll(() => {
this.distDir = '.'
this.buildId = mockBuildId
this.nextConfig = nextOptions.conf
this.renderOpts = { previewProps: {} }
this.netlifyConfig = netlifyConfig
this.netlifyPrebundleReact = jest.fn()
}
Object.setPrototypeOf(NetlifyNextServer, MockNetlifyNextServerConstructor)
})

describe('the netlify next server', () => {
it.skip('does not revalidate a request without an `x-prerender-revalidate` header', async () => {
it('does not revalidate a request without an `x-prerender-revalidate` header', async () => {
const netlifyNextServer = new NetlifyNextServer({ conf: {} }, { ...mockTokenConfig })
const requestHandler = netlifyNextServer.getRequestHandler()

Expand All @@ -92,7 +94,7 @@ describe('the netlify next server', () => {
expect(mockedApiFetch).not.toHaveBeenCalled()
})

it.skip('revalidates a static non-i18n route with an `x-prerender-revalidate` header', async () => {
it('revalidates a static non-i18n route with an `x-prerender-revalidate` header', async () => {
const netlifyNextServer = new NetlifyNextServer({ conf: {} }, { ...mockTokenConfig })
const requestHandler = netlifyNextServer.getRequestHandler()

Expand All @@ -112,7 +114,7 @@ describe('the netlify next server', () => {
)
})

it.skip('revalidates a static i18n route with an `x-prerender-revalidate` header', async () => {
it('revalidates a static i18n route with an `x-prerender-revalidate` header', async () => {
const netlifyNextServer = new NetlifyNextServer({ conf: { ...mocki18nConfig } }, { ...mockTokenConfig })
const requestHandler = netlifyNextServer.getRequestHandler()

Expand All @@ -132,7 +134,7 @@ describe('the netlify next server', () => {
)
})

it.skip('revalidates a dynamic non-i18n route with an `x-prerender-revalidate` header', async () => {
it('revalidates a dynamic non-i18n route with an `x-prerender-revalidate` header', async () => {
const netlifyNextServer = new NetlifyNextServer({ conf: {} }, { ...mockTokenConfig })
const requestHandler = netlifyNextServer.getRequestHandler()

Expand All @@ -152,7 +154,7 @@ describe('the netlify next server', () => {
)
})

it.skip('revalidates a dynamic i18n route with an `x-prerender-revalidate` header', async () => {
it('revalidates a dynamic i18n route with an `x-prerender-revalidate` header', async () => {
const netlifyNextServer = new NetlifyNextServer({ conf: { ...mocki18nConfig } }, { ...mockTokenConfig })
const requestHandler = netlifyNextServer.getRequestHandler()

Expand All @@ -172,7 +174,7 @@ describe('the netlify next server', () => {
)
})

it.skip('throws an error when route is not found in the manifest', async () => {
it('throws an error when route is not found in the manifest', async () => {
const netlifyNextServer = new NetlifyNextServer({ conf: {} }, mockTokenConfig)
const requestHandler = netlifyNextServer.getRequestHandler()

Expand All @@ -187,7 +189,7 @@ describe('the netlify next server', () => {
)
})

it.skip('throws an error when paths are not found by the API', async () => {
it('throws an error when paths are not found by the API', async () => {
const netlifyNextServer = new NetlifyNextServer({ conf: {} }, mockTokenConfig)
const requestHandler = netlifyNextServer.getRequestHandler()

Expand All @@ -203,7 +205,7 @@ describe('the netlify next server', () => {
)
})

it.skip('throws an error when the revalidate API is unreachable', async () => {
it('throws an error when the revalidate API is unreachable', async () => {
const netlifyNextServer = new NetlifyNextServer({ conf: {} }, mockTokenConfig)
const requestHandler = netlifyNextServer.getRequestHandler()

Expand Down