Download next.js/test/production/standalone-mode/optimizecss/index.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/standalone-mode/optimizecss/index.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/production/standalone-mode/optimizecss/index.test.ts
-
curl -L -o index.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/standalone-mode/optimizecss/index.test.ts
1.05 kB
| import { createNext } from 'e2e-utils' | |
| import { NextInstance } from 'e2e-utils' | |
| import { renderViaHTTP } from 'next-test-utils' | |
| describe('standalone mode and optimizeCss', () => { | |
| let next: NextInstance | |
| beforeAll(async () => { | |
| next = await createNext({ | |
| files: { | |
| 'pages/index.js': ` | |
| import styles from './index.module.css' | |
| export default function Page() { | |
| return <p className={styles.home}>hello world</p> | |
| } | |
| `, | |
| 'pages/index.module.css': ` | |
| .home { | |
| background: orange; | |
| color: black; | |
| } | |
| `, | |
| }, | |
| nextConfig: { | |
| experimental: { | |
| optimizeCss: true, | |
| }, | |
| output: 'standalone', | |
| }, | |
| dependencies: { | |
| critters: '0.0.16', | |
| }, | |
| }) | |
| }) | |
| afterAll(() => next.destroy()) | |
| it('should work', async () => { | |
| const html = await renderViaHTTP(next.url, '/') | |
| expect(html).toContain('hello world') | |
| expect(html).toContain('background:orange') | |
| }) | |
| }) | |