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
541cd01b
Unverified
Commit
541cd01b
authored
Mar 23, 2020
by
Tim Neutkens
Committed by
GitHub
Mar 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for single alias (#11296)
parent
c68de947
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
2 deletions
+42
-2
hello.js
test/integration/jsconfig-paths/components/hello.js
+5
-0
jsconfig.json
test/integration/jsconfig-paths/jsconfig.json
+2
-1
single-alias.js
test/integration/jsconfig-paths/pages/single-alias.js
+9
-0
index.test.js
test/integration/jsconfig-paths/test/index.test.js
+5
-0
hello.tsx
test/integration/typescript-paths/components/hello.tsx
+5
-0
single-alias.tsx
test/integration/typescript-paths/pages/single-alias.tsx
+9
-0
index.test.js
test/integration/typescript-paths/test/index.test.js
+5
-0
tsconfig.json
test/integration/typescript-paths/tsconfig.json
+2
-1
No files found.
test/integration/jsconfig-paths/components/hello.js
0 → 100644
View file @
541cd01b
import
React
from
'react'
export
function
Hello
()
{
return
<>
Hello
<
/
>
}
test/integration/jsconfig-paths/jsconfig.json
View file @
541cd01b
...
...
@@ -3,7 +3,8 @@
"baseUrl"
:
"."
,
"paths"
:
{
"@c/*"
:
[
"components/*"
],
"@lib/*"
:
[
"lib/a/*"
,
"lib/b/*"
]
"@lib/*"
:
[
"lib/a/*"
,
"lib/b/*"
],
"@mycomponent"
:
[
"components/hello.js"
]
}
}
}
test/integration/jsconfig-paths/pages/single-alias.js
0 → 100644
View file @
541cd01b
import
{
Hello
}
from
'@mycomponent'
export
default
function
SingleAlias
()
{
return
(
<
div
>
<
Hello
/>
<
/div
>
)
}
test/integration/jsconfig-paths/test/index.test.js
View file @
541cd01b
...
...
@@ -37,5 +37,10 @@ describe('TypeScript Features', () => {
const
$
=
await
get
$
(
'/resolve-fallback'
)
expect
(
$
(
'body'
).
text
()).
toMatch
(
/Hello from only b/
)
})
it
(
'should resolve a single matching alias'
,
async
()
=>
{
const
$
=
await
get
$
(
'/single-alias'
)
expect
(
$
(
'body'
).
text
()).
toMatch
(
/Hello/
)
})
})
})
test/integration/typescript-paths/components/hello.tsx
0 → 100644
View file @
541cd01b
import
React
from
'react'
export
function
Hello
()
{
return
<>
Hello
</>
}
test/integration/typescript-paths/pages/single-alias.tsx
0 → 100644
View file @
541cd01b
import
{
Hello
}
from
'@mycomponent'
export
default
function
SingleAlias
()
{
return
(
<
div
>
<
Hello
/>
</
div
>
)
}
test/integration/typescript-paths/test/index.test.js
View file @
541cd01b
...
...
@@ -37,5 +37,10 @@ describe('TypeScript Features', () => {
const
$
=
await
get
$
(
'/resolve-fallback'
)
expect
(
$
(
'body'
).
text
()).
toMatch
(
/Hello from only b/
)
})
it
(
'should resolve a single matching alias'
,
async
()
=>
{
const
$
=
await
get
$
(
'/single-alias'
)
expect
(
$
(
'body'
).
text
()).
toMatch
(
/Hello/
)
})
})
})
test/integration/typescript-paths/tsconfig.json
View file @
541cd01b
...
...
@@ -3,7 +3,8 @@
"baseUrl"
:
"."
,
"paths"
:
{
"@c/*"
:
[
"components/*"
],
"@lib/*"
:
[
"lib/a/*"
,
"lib/b/*"
]
"@lib/*"
:
[
"lib/a/*"
,
"lib/b/*"
],
"@mycomponent"
:
[
"components/hello.tsx"
]
},
"esModuleInterop"
:
true
,
"module"
:
"esnext"
,
...
...
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