-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: set content type based on entry point
- Loading branch information
1 parent
4bb993d
commit 9a70d79
Showing
2 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,10 +51,20 @@ test('specific tag', async () => { | |
assert.strictEqual(actual, expected) | ||
}) | ||
|
||
test('omit entry point', async () => { | ||
const actual = await fetchStr('http://localhost:3000/esbuild/[email protected]') | ||
test('omit entry point', async (t) => { | ||
await t.test('js', async () => { | ||
const res = await fetch('http://localhost:3000/esbuild/[email protected]') | ||
|
||
assert.strictEqual(actual, `export * from 'https://deno.re/esbuild/[email protected]/mod.js'`) | ||
assert.strictEqual(await res.text(), `export * from 'https://deno.re/esbuild/[email protected]/mod.js'`) | ||
assert.strictEqual(res.headers.get('content-type'), 'text/javascript; charset=utf-8') | ||
}) | ||
|
||
await t.test('ts', async () => { | ||
const res = await fetch('http://localhost:3000/[email protected]/crypto') | ||
|
||
assert.strictEqual(await res.text(), `export * from 'https://deno.re/[email protected]/crypto/mod.ts'`) | ||
assert.strictEqual(res.headers.get('content-type'), 'text/typescript; charset=utf-8') | ||
}) | ||
}) | ||
|
||
test('type header', async () => { | ||
|