Skip to content

Commit

Permalink
test: revert Prevent regressions in static file serving of files outs…
Browse files Browse the repository at this point in the history
…ide the root (vitejs#2358) (vitejs#3015)

This reverts commit ee7eb82.
  • Loading branch information
patak-dev authored and TobiasMelen committed May 3, 2021
1 parent 144d9b5 commit 94386cf
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 25 deletions.
10 changes: 0 additions & 10 deletions packages/playground/assets/__tests__/assets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ const assetMatch = isBuild
? /\/foo\/assets\/asset\.\w{8}\.png/
: '/foo/nested/asset.png'

const outerAssetMatch = isBuild
? /\/foo\/assets\/asset\.\w{8}\.png/
: /\/foo\/@fs\/.+?\/css\/nested\/asset\.png/

const iconMatch = `/foo/icon.png`

test('should have no 404s', () => {
Expand Down Expand Up @@ -68,12 +64,6 @@ describe('asset imports from js', () => {
expect(await page.textContent('.asset-import-absolute')).toMatch(assetMatch)
})

test('outer', async () => {
expect(await page.textContent('.asset-import-outer')).toMatch(
outerAssetMatch
)
})

test('from /public', async () => {
expect(await page.textContent('.public-import')).toMatch(iconMatch)
})
Expand Down
14 changes: 0 additions & 14 deletions packages/playground/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,14 @@ <h2>Raw References from publicDir</h2>
Raw CSS from publicDir should load (this should be red)
</li>
<li>
Filename with whitespace
<img src="/white space.png" />
</li>
<li>
Outer file using @fs
<img class="asset-outer-img" alt="img" />
</li>
</ul>

<h2>Asset Imports from JS</h2>
<ul>
<li>Relative: <code class="asset-import-relative"></code></li>
<li>Absolute: <code class="asset-import-absolute"></code></li>
<li>Outer (@fs): <code class="asset-import-outer"></code></li>
<li>From publicDir: <code class="public-import"></code></li>
</ul>

Expand Down Expand Up @@ -137,10 +131,6 @@ <h2>?url import</h2>
import absoluteUrl from '/nested/asset.png'
text('.asset-import-absolute', absoluteUrl)

import outerUrl from '@playground/css/nested/asset.png'
text('.asset-import-outer', outerUrl)
src('.asset-outer-img', outerUrl)

import publicUrl from '/icon.png'
text('.public-import', publicUrl)

Expand All @@ -157,8 +147,4 @@ <h2>?url import</h2>
function text(el, text) {
document.querySelector(el).textContent = text
}

function src(el, src) {
document.querySelector(el).src = src
}
</script>
1 change: 0 additions & 1 deletion packages/playground/assets/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module.exports = {
publicDir: 'static',
resolve: {
alias: {
'@playground': path.resolve(__dirname, '..'),
'@': path.resolve(__dirname, 'nested')
}
},
Expand Down
Binary file removed packages/playground/css/nested/asset.png
Binary file not shown.

0 comments on commit 94386cf

Please sign in to comment.