Commit 488a21b8 authored by Jude Gao's avatar Jude Gao

[create-next-app] Make vercel.svg viewBox square to eliminate browser warning

parent c2914790
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg> <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1155"><path d="m577.3 77.5 577.4 1000H0z" fill="#fff"/></svg>
\ No newline at end of file \ No newline at end of file
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg> <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1155"><path d="m577.3 77.5 577.4 1000H0z" fill="#fff"/></svg>
\ No newline at end of file \ No newline at end of file
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg> <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1155"><path d="m577.3 77.5 577.4 1000H0z" fill="#fff"/></svg>
\ No newline at end of file \ No newline at end of file
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg> <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1155"><path d="m577.3 77.5 577.4 1000H0z" fill="#fff"/></svg>
\ No newline at end of file \ No newline at end of file
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg> <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1155"><path d="m577.3 77.5 577.4 1000H0z" fill="#fff"/></svg>
\ No newline at end of file \ No newline at end of file
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg> <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1155"><path d="m577.3 77.5 577.4 1000H0z" fill="#fff"/></svg>
\ No newline at end of file \ No newline at end of file
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg> <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1155"><path d="m577.3 77.5 577.4 1000H0z" fill="#fff"/></svg>
\ No newline at end of file \ No newline at end of file
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg> <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1155"><path d="m577.3 77.5 577.4 1000H0z" fill="#fff"/></svg>
\ No newline at end of file \ No newline at end of file
import { run, useTempDir } from '../utils'
import { findPort, killApp, launchApp, retry, waitFor } from 'next-test-utils'
import webdriver from 'next-webdriver'
import { join } from 'path'
describe('create-next-app templates should have no browser warnings', () => {
let nextTgzFilename: string
beforeAll(() => {
if (!process.env.NEXT_TEST_PKG_PATHS) {
throw new Error('This test needs to be run with `node run-tests.js`.')
}
const pkgPaths = new Map<string, string>(
JSON.parse(process.env.NEXT_TEST_PKG_PATHS)
)
nextTgzFilename = pkgPaths.get('next')!
})
it('should have no browser warnings or errors with --tailwind', async () => {
await useTempDir(async (cwd) => {
const projectName = 'app-tw-no-warnings'
const { exitCode } = await run(
[
projectName,
'--ts',
'--app',
'--eslint',
'--no-src-dir',
'--tailwind',
'--no-import-alias',
'--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
],
nextTgzFilename,
{ cwd }
)
expect(exitCode).toBe(0)
const dir = join(cwd, projectName)
const port = await findPort()
const app = await launchApp(dir, port, {
nextBin: join(dir, 'node_modules/next/dist/bin/next'),
})
try {
const browser = await webdriver(port, '/')
await waitFor(2000)
await retry(async () => {
const logs = await browser.log()
const allMessages = logs.map((log: any) => log.message).join('\n')
expect(
allMessages.includes('hydrate callback') ||
allMessages.includes('already hydrated')
).toBe(true)
const warnings = logs.filter((log: any) => log.source === 'warning')
const errors = logs.filter((log: any) => log.source === 'error')
expect(warnings).toEqual([])
expect(errors).toEqual([])
})
await browser.close()
} finally {
await killApp(app)
}
})
})
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment