Skip to content
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

Fix flaky css test and remove unused tests deps #47806

Merged
merged 5 commits into from Apr 1, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion test/e2e/app-dir/app-basepath/index.test.ts
Expand Up @@ -6,7 +6,6 @@ createNextDescribe(
files: __dirname,
skipDeployment: true,
dependencies: {
swr: '2.0.0-rc.0',
react: 'latest',
'react-dom': 'latest',
sass: 'latest',
Expand Down
7 changes: 3 additions & 4 deletions test/e2e/app-dir/app-css/index.test.ts
Expand Up @@ -7,7 +7,6 @@ createNextDescribe(
files: __dirname,
skipDeployment: true,
dependencies: {
swr: '2.0.0-rc.0',
'@picocss/pico': '1.5.7',
react: 'latest',
'react-dom': 'latest',
Expand Down Expand Up @@ -506,9 +505,9 @@ createNextDescribe(
const browser = await next.browser('/suspensey-css')
await browser.elementByCss('#slow').click()
await check(() => browser.eval(`document.body.innerText`), 'Get back')
expect(await browser.eval(`window.__log`)).toEqual(
'background = rgb(255, 255, 0)'
)
await check(async () => {
return await browser.eval(`window.__log`)
}, /background = rgb\(255, 255, 0\)/)
})

it('should timeout if the resource takes too long', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/app-dir/app-external/app-external.test.ts
Expand Up @@ -21,7 +21,7 @@ createNextDescribe(
dependencies: {
react: 'latest',
'react-dom': 'latest',
swr: '2.0.0-rc.0',
swr: 'latest',
},
packageJson: {
scripts: {
Expand Down
9 changes: 0 additions & 9 deletions test/e2e/app-dir/app/index.test.ts
Expand Up @@ -8,12 +8,6 @@ createNextDescribe(
'app dir',
{
files: __dirname,
dependencies: {
swr: '2.0.0-rc.0',
react: 'latest',
'react-dom': 'latest',
sass: 'latest',
},
},
({ next, isNextDev: isDev, isNextStart, isNextDeploy }) => {
if (!isDev) {
Expand Down Expand Up @@ -215,9 +209,6 @@ createNextDescribe(
it('should serve from pages', async () => {
const html = await next.render('/')
expect(html).toContain('hello from pages/index')

// esm imports should work fine in pages/
expect(html).toContain('swr-index')
})

it('should serve dynamic route from pages', async () => {
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/app-dir/app/pages/index.js
@@ -1,15 +1,12 @@
import React from 'react'
import Link from 'next/link'
import useSWR from 'swr'
import styles from '../styles/shared.module.css'

export default function Page() {
const { data } = useSWR('swr-index', (v) => v, { fallbackData: 'swr-index' })
return (
<>
<p className={styles.content}>hello from pages/index</p>
<Link href="/dashboard">Dashboard</Link>
<div>{data}</div>
</>
)
}
6 changes: 0 additions & 6 deletions test/e2e/app-dir/app/standalone.test.ts
Expand Up @@ -16,12 +16,6 @@ if (!(globalThis as any).isNextStart) {
'output: standalone with app dir',
{
files: __dirname,
dependencies: {
swr: '2.0.0-rc.0',
react: 'latest',
'react-dom': 'latest',
sass: 'latest',
},
skipStart: true,
},
({ next }) => {
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/app-dir/app/useReportWebVitals.test.ts
Expand Up @@ -8,12 +8,6 @@ describe('useReportWebVitals hook', () => {
beforeAll(async () => {
next = await createNext({
files: __dirname,
dependencies: {
swr: '2.0.0-rc.0',
react: 'latest',
'react-dom': 'latest',
sass: 'latest',
},
skipStart: true,
env: {},
})
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/app-dir/app/vercel-analytics.test.ts
Expand Up @@ -16,12 +16,6 @@ describe('vercel analytics', () => {
beforeAll(async () => {
next = await createNext({
files: __dirname,
dependencies: {
swr: '2.0.0-rc.0',
react: 'latest',
'react-dom': 'latest',
sass: 'latest',
},
skipStart: true,
env: {
VERCEL_ANALYTICS_ID: 'fake-analytics-id',
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/app-dir/hooks/hooks.test.ts
Expand Up @@ -4,12 +4,6 @@ createNextDescribe(
'app dir - hooks',
{
files: __dirname,
dependencies: {
swr: 'latest',
react: 'latest',
'react-dom': 'latest',
sass: 'latest',
},
},
({ next, isNextDeploy }) => {
describe('from pages', () => {
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/app-dir/navigation/navigation.test.ts
Expand Up @@ -6,12 +6,6 @@ createNextDescribe(
'app dir - navigation',
{
files: __dirname,
dependencies: {
swr: 'latest',
react: 'latest',
'react-dom': 'latest',
sass: 'latest',
},
},
({ next, isNextDeploy }) => {
describe('query string', () => {
Expand Down