Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
be03a1d1
Unverified
Commit
be03a1d1
authored
Nov 15, 2021
by
JJ Kasper
Committed by
GitHub
Nov 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove .only and ensure jest lint rules apply for all tests (#31456)
parent
ef579532
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
119 deletions
+13
-119
.eslintrc.json
.eslintrc.json
+3
-2
styled-components-disabled.test.ts
test/development/basic/styled-components-disabled.test.ts
+1
-0
shared.js
test/integration/i18n-support/test/shared.js
+1
-1
security.js
test/integration/production-swcminify/test/security.js
+0
-54
security.js
test/integration/production/test/security.js
+0
-54
css.js
...gration/react-streaming-and-server-components/test/css.js
+7
-7
required-server-files-i18n.test.ts
test/production/required-server-files-i18n.test.ts
+1
-1
No files found.
.eslintrc.json
View file @
be03a1d1
...
@@ -30,14 +30,15 @@
...
@@ -30,14 +30,15 @@
},
},
"overrides"
:
[
"overrides"
:
[
{
{
"files"
:
[
"test/**/*.
test.j
s"
],
"files"
:
[
"test/**/*.
js"
,
"test/**/*.ts"
,
"**/*.test.t
s"
],
"extends"
:
[
"plugin:jest/recommended"
],
"extends"
:
[
"plugin:jest/recommended"
],
"rules"
:
{
"rules"
:
{
"jest/expect-expect"
:
"off"
,
"jest/expect-expect"
:
"off"
,
"jest/no-disabled-tests"
:
"off"
,
"jest/no-disabled-tests"
:
"off"
,
"jest/no-conditional-expect"
:
"off"
,
"jest/no-conditional-expect"
:
"off"
,
"jest/valid-title"
:
"off"
,
"jest/valid-title"
:
"off"
,
"jest/no-interpolation-in-snapshots"
:
"off"
"jest/no-interpolation-in-snapshots"
:
"off"
,
"jest/no-export"
:
"off"
}
}
},
},
{
"files"
:
[
"**/__tests__/**"
],
"env"
:
{
"jest"
:
true
}
},
{
"files"
:
[
"**/__tests__/**"
],
"env"
:
{
"jest"
:
true
}
},
...
...
test/development/basic/styled-components-disabled.test.ts
View file @
be03a1d1
...
@@ -54,6 +54,7 @@ describe('styled-components SWC transform', () => {
...
@@ -54,6 +54,7 @@ describe('styled-components SWC transform', () => {
throw
new
Error
(
'did not find mismatch'
)
throw
new
Error
(
'did not find mismatch'
)
}
catch
(
err
)
{
}
catch
(
err
)
{
// Verify that it really has the logs
// Verify that it really has the logs
// eslint-disable-next-line jest/no-try-expect
expect
(
await
matchLogs$
(
browser
)).
toBe
(
true
)
expect
(
await
matchLogs$
(
browser
)).
toBe
(
true
)
}
}
}
finally
{
}
finally
{
...
...
test/integration/i18n-support/test/shared.js
View file @
be03a1d1
...
@@ -36,7 +36,7 @@ async function addDefaultLocaleCookie(browser) {
...
@@ -36,7 +36,7 @@ async function addDefaultLocaleCookie(browser) {
export
function
runTests
(
ctx
)
{
export
function
runTests
(
ctx
)
{
if
(
ctx
.
basePath
)
{
if
(
ctx
.
basePath
)
{
it
.
only
(
'should handle basePath like pathname'
,
async
()
=>
{
it
(
'should handle basePath like pathname'
,
async
()
=>
{
const
{
basePath
}
=
ctx
const
{
basePath
}
=
ctx
for
(
const
pathname
of
[
for
(
const
pathname
of
[
...
...
test/integration/production-swcminify/test/security.js
View file @
be03a1d1
...
@@ -291,60 +291,6 @@ module.exports = (context) => {
...
@@ -291,60 +291,6 @@ module.exports = (context) => {
expect
(
hostname
).
not
.
toBe
(
'example.com'
)
expect
(
hostname
).
not
.
toBe
(
'example.com'
)
})
})
it
(
'should handle encoded value in the pathname correctly /'
,
async
()
=>
{
const
res
=
await
fetchViaHTTP
(
context
.
appPort
,
'/redirect/me/to-about/%2fgoogle.com'
,
undefined
,
{
redirect
:
'manual'
,
}
)
const
{
pathname
,
hostname
}
=
url
.
parse
(
res
.
headers
.
get
(
'location'
)
||
''
)
expect
(
res
.
status
).
toBe
(
307
)
expect
(
pathname
).
toBe
(
'/%2fgoogle.com/about'
)
expect
(
hostname
).
not
.
toBe
(
'google.com'
)
})
it
(
'should handle encoded value in the pathname to query correctly (/)'
,
async
()
=>
{
const
res
=
await
fetchViaHTTP
(
context
.
appPort
,
'/redirect-query-test/%2Fgoogle.com'
,
undefined
,
{
redirect
:
'manual'
,
}
)
const
{
pathname
,
hostname
,
query
}
=
url
.
parse
(
res
.
headers
.
get
(
'location'
)
||
''
)
expect
(
res
.
status
).
toBe
(
307
)
expect
(
pathname
).
toBe
(
'/about'
)
expect
(
query
).
toBe
(
'foo=%2Fgoogle.com'
)
expect
(
hostname
).
not
.
toBe
(
'google.com'
)
expect
(
hostname
).
not
.
toMatch
(
/google/
)
})
it
(
'should handle encoded / value for trailing slash correctly'
,
async
()
=>
{
const
res
=
await
fetchViaHTTP
(
context
.
appPort
,
'/%2fexample.com/'
,
undefined
,
{
redirect
:
'manual'
}
)
const
{
pathname
,
hostname
}
=
url
.
parse
(
res
.
headers
.
get
(
'location'
)
||
''
)
expect
(
res
.
status
).
toBe
(
308
)
expect
(
pathname
).
toBe
(
'/%2fexample.com'
)
expect
(
hostname
).
not
.
toBe
(
'example.com'
)
})
if
(
browserName
!==
'internet explorer'
)
{
if
(
browserName
!==
'internet explorer'
)
{
it
(
'should not execute script embedded inside svg image'
,
async
()
=>
{
it
(
'should not execute script embedded inside svg image'
,
async
()
=>
{
let
browser
let
browser
...
...
test/integration/production/test/security.js
View file @
be03a1d1
...
@@ -291,60 +291,6 @@ module.exports = (context) => {
...
@@ -291,60 +291,6 @@ module.exports = (context) => {
expect
(
hostname
).
not
.
toBe
(
'example.com'
)
expect
(
hostname
).
not
.
toBe
(
'example.com'
)
})
})
it
(
'should handle encoded value in the pathname correctly /'
,
async
()
=>
{
const
res
=
await
fetchViaHTTP
(
context
.
appPort
,
'/redirect/me/to-about/%2fgoogle.com'
,
undefined
,
{
redirect
:
'manual'
,
}
)
const
{
pathname
,
hostname
}
=
url
.
parse
(
res
.
headers
.
get
(
'location'
)
||
''
)
expect
(
res
.
status
).
toBe
(
307
)
expect
(
pathname
).
toBe
(
'/%2fgoogle.com/about'
)
expect
(
hostname
).
not
.
toBe
(
'google.com'
)
})
it
(
'should handle encoded value in the pathname to query correctly (/)'
,
async
()
=>
{
const
res
=
await
fetchViaHTTP
(
context
.
appPort
,
'/redirect-query-test/%2Fgoogle.com'
,
undefined
,
{
redirect
:
'manual'
,
}
)
const
{
pathname
,
hostname
,
query
}
=
url
.
parse
(
res
.
headers
.
get
(
'location'
)
||
''
)
expect
(
res
.
status
).
toBe
(
307
)
expect
(
pathname
).
toBe
(
'/about'
)
expect
(
query
).
toBe
(
'foo=%2Fgoogle.com'
)
expect
(
hostname
).
not
.
toBe
(
'google.com'
)
expect
(
hostname
).
not
.
toMatch
(
/google/
)
})
it
(
'should handle encoded / value for trailing slash correctly'
,
async
()
=>
{
const
res
=
await
fetchViaHTTP
(
context
.
appPort
,
'/%2fexample.com/'
,
undefined
,
{
redirect
:
'manual'
}
)
const
{
pathname
,
hostname
}
=
url
.
parse
(
res
.
headers
.
get
(
'location'
)
||
''
)
expect
(
res
.
status
).
toBe
(
308
)
expect
(
pathname
).
toBe
(
'/%2fexample.com'
)
expect
(
hostname
).
not
.
toBe
(
'example.com'
)
})
if
(
browserName
!==
'internet explorer'
)
{
if
(
browserName
!==
'internet explorer'
)
{
it
(
'should not execute script embedded inside svg image'
,
async
()
=>
{
it
(
'should not execute script embedded inside svg image'
,
async
()
=>
{
let
browser
let
browser
...
...
test/integration/react-streaming-and-server-components/test/css.js
View file @
be03a1d1
...
@@ -17,11 +17,11 @@ export default function (context) {
...
@@ -17,11 +17,11 @@ export default function (context) {
expect
(
currentColor
).
toMatchInlineSnapshot
(
`"rgb(255, 0, 0)"`
)
expect
(
currentColor
).
toMatchInlineSnapshot
(
`"rgb(255, 0, 0)"`
)
})
})
// TODO: fix this test
// TODO: fix this test
//
it.skip('should include css modules with `serverComponents: true`', async () => {
it
.
skip
(
'should include css modules with `serverComponents: true`'
,
async
()
=>
{
//
const browser = await webdriver(context.appPort, '/css-modules')
const
browser
=
await
webdriver
(
context
.
appPort
,
'/css-modules'
)
//
const currentColor = await browser.eval(
const
currentColor
=
await
browser
.
eval
(
//
`window.getComputedStyle(document.querySelector('h1')).color`
`window.getComputedStyle(document.querySelector('h1')).color`
//
)
)
//
expect(currentColor).toMatchInlineSnapshot(`"rgb(255, 0, 0)"`)
expect
(
currentColor
).
toMatchInlineSnapshot
(
`"rgb(255, 0, 0)"`
)
//
})
})
}
}
test/production/required-server-files-i18n.test.ts
View file @
be03a1d1
...
@@ -701,7 +701,7 @@ describe('should set-up next', () => {
...
@@ -701,7 +701,7 @@ describe('should set-up next', () => {
expect
(
JSON
.
parse
(
$
(
'#router'
).
text
()).
locale
).
toBe
(
'en'
)
expect
(
JSON
.
parse
(
$
(
'#router'
).
text
()).
locale
).
toBe
(
'en'
)
})
})
it
(
'should have the correct asPath for fallback page'
,
async
()
=>
{
it
(
'should have the correct asPath for fallback page
locale
'
,
async
()
=>
{
const
res
=
await
fetchViaHTTP
(
appPort
,
'/fr/fallback/[slug]'
,
undefined
,
{
const
res
=
await
fetchViaHTTP
(
appPort
,
'/fr/fallback/[slug]'
,
undefined
,
{
headers
:
{
headers
:
{
'x-matched-path'
:
'/fr/fallback/[slug]'
,
'x-matched-path'
:
'/fr/fallback/[slug]'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment