Skip to content

Commit

Permalink
fix: add resolve ts tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
leebeydoun committed Feb 27, 2022
1 parent be38af3 commit af4e0e7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
17 changes: 17 additions & 0 deletions packages/playground/resolve/index.html
Expand Up @@ -38,6 +38,17 @@ <h2>
</h2>
<p class="ts-extension">fail</p>

<h2>
A ts module can import another tsx module using its corresponding jsx file
name
</h2>
<p class="jsx-extension">fail</p>

<h2>
A ts module can import another tsx module using its corresponding js file name
</h2>
<p class="tsx-extension">fail</p>

<h2>Resolve file name containing dot</h2>
<p class="dot">fail</p>

Expand Down Expand Up @@ -130,6 +141,12 @@ <h2>resolve package that contains # in path</h2>
import { msg as tsExtensionMsg } from './ts-extension'
text('.ts-extension', tsExtensionMsg)

import { msgJsx as tsJsxExtensionMsg } from './ts-extension'
text('.jsx-extension', tsJsxExtensionMsg)

import { msgTsx as tsTsxExtensionMsg } from './ts-extension'
text('.tsx-extension', tsTsxExtensionMsg)

// filename with dot
import { bar } from './util/bar.util'
text('.dot', bar())
Expand Down
1 change: 1 addition & 0 deletions packages/playground/resolve/ts-extension/hellojsx.tsx
@@ -0,0 +1 @@
export const msgJsx = '[success] use .jsx extension to import a tsx module'
1 change: 1 addition & 0 deletions packages/playground/resolve/ts-extension/hellotsx.tsx
@@ -0,0 +1 @@
export const msgTsx = '[success] use .js extension to import a tsx module'
4 changes: 3 additions & 1 deletion packages/playground/resolve/ts-extension/index.ts
@@ -1,3 +1,5 @@
import { msg } from './hello.js'
import { msgJsx } from './hellojsx.jsx'
import { msgTsx } from './hellotsx.js'

export { msg }
export { msg, msgJsx, msgTsx }

0 comments on commit af4e0e7

Please sign in to comment.