Skip to content

Commit

Permalink
fix: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hpx7 committed Jun 10, 2021
1 parent f525e3e commit 2873045
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/playground/optimize-deps/.hidden-dir/foo.js
@@ -0,0 +1 @@
export const greeting = 'hello!'
Expand Up @@ -67,3 +67,7 @@ test('esbuild-plugin', async () => {
isBuild ? `Hello from a package` : `Hello from an esbuild plugin`
)
})

test('import from hidden dir', async () => {
expect(await page.textContent('.hidden-dir')).toBe('hello!')
})
6 changes: 6 additions & 0 deletions packages/playground/optimize-deps/index.html
Expand Up @@ -43,6 +43,9 @@ <h2>Vue & Vuex</h2>
<h2>Dep with changes from esbuild plugin</h2>
<div>This should show a greeting: <span class="esbuild-plugin"></span></div>

<h2>Dep from hidden dir</h2>
<div>This should show hello!: <span class="hidden-dir"></span></div>

<script type="module">
// test dep detection in globbed files
const globbed = import.meta.globEager('./glob/*.js')
Expand Down Expand Up @@ -70,4 +73,7 @@ <h2>Dep with changes from esbuild plugin</h2>

import { hello } from 'dep-esbuild-plugin-transform'
document.querySelector('.esbuild-plugin').textContent = hello()

import { greeting } from '.hidden-dir/foo.js'
document.querySelector('.hidden-dir').textContent = greeting
</script>

0 comments on commit 2873045

Please sign in to comment.