react-code-dataset / next.js /test /development /experimental-https-server /https-server-opengraph-image.test.ts
Download next.js/test/development/experimental-https-server/https-server-opengraph-image.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/experimental-https-server/https-server-opengraph-image.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/experimental-https-server/https-server-opengraph-image.test.ts
-
curl -L -o https-server-opengraph-image.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/experimental-https-server/https-server-opengraph-image.test.ts
1.13 kB
| import { nextTestSetup } from 'e2e-utils' | |
| import { shouldRunTurboDevTest } from 'next-test-utils' | |
| describe('experimental-https-server OpenGraph image', () => { | |
| const { next, skipped } = nextTestSetup({ | |
| files: __dirname, | |
| startCommand: `pnpm next ${ | |
| shouldRunTurboDevTest() ? 'dev --turbo' : 'dev' | |
| } --experimental-https`, | |
| skipStart: !process.env.NEXT_TEST_CI, | |
| }) | |
| if (skipped) return | |
| if (!process.env.NEXT_TEST_CI) { | |
| console.warn('only runs on CI as it requires administrator privileges') | |
| it('only runs on CI as it requires administrator privileges', () => {}) | |
| return | |
| } | |
| it('should generate https:// URLs for OpenGraph images when experimental HTTPS is enabled', async () => { | |
| expect(next.url).toContain('https://') | |
| const browser = await next.browser('/1', { | |
| ignoreHTTPSErrors: true, | |
| }) | |
| const html = await browser.eval('document.documentElement.innerHTML') | |
| expect(html).toContain('Hello from App') | |
| expect(html).toMatch(/<meta property="og:image" content="https:\/\//) | |
| expect(html).toMatch(/<meta name="twitter:image" content="https:\/\//) | |
| }) | |
| }) | |