Skip to content

Commit

Permalink
Refactor to silence checked esbuild error messages
Browse files Browse the repository at this point in the history
Closes GH-2329.

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
remcohaszing authored Jul 18, 2023
1 parent d2ce50f commit 57ebce5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/esbuild/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ test('@mdx-js/esbuild', async (t) => {
await fs.writeFile(new URL('esbuild.md', import.meta.url), 'a')
await fs.writeFile(new URL('esbuild.mdx', import.meta.url), 'a')

console.log('\nnote: the following error is expected!\n')
await assert.rejects(
esbuild.build({
logLevel: 'silent',
entryPoints: [fileURLToPath(new URL('esbuild.md', import.meta.url))],
outfile: fileURLToPath(
new URL('esbuild-md-as-mdx.js', import.meta.url)
Expand All @@ -153,9 +153,9 @@ test('@mdx-js/esbuild', async (t) => {
})

await t.test('should not handle `.mdx` files w/ `format: md`', async () => {
console.log('\nnote: the following error is expected!\n')
await assert.rejects(
esbuild.build({
logLevel: 'silent',
entryPoints: [fileURLToPath(new URL('esbuild.mdx', import.meta.url))],
outfile: fileURLToPath(
new URL('esbuild-md-as-mdx.js', import.meta.url)
Expand All @@ -170,14 +170,14 @@ test('@mdx-js/esbuild', async (t) => {
await fs.rm(new URL('esbuild.mdx', import.meta.url), {force: true})

await t.test('should pass errors (1)', async () => {
console.log('\nnote: the following errors and warnings are expected!\n')
await fs.writeFile(
new URL('esbuild-broken.mdx', import.meta.url),
'asd <https://example.com>?'
)

await assert.rejects(
esbuild.build({
logLevel: 'silent',
entryPoints: [
fileURLToPath(new URL('esbuild-broken.mdx', import.meta.url))
],
Expand Down Expand Up @@ -219,6 +219,7 @@ test('@mdx-js/esbuild', async (t) => {

await assert.rejects(
esbuild.build({
logLevel: 'silent',
entryPoints: [
fileURLToPath(new URL('esbuild-warnings.mdx', import.meta.url))
],
Expand Down Expand Up @@ -392,6 +393,7 @@ test('@mdx-js/esbuild', async (t) => {

await assert.rejects(
esbuild.build({
logLevel: 'silent',
entryPoints: [
fileURLToPath(new URL('esbuild-plugin-crash.mdx', import.meta.url))
],
Expand Down Expand Up @@ -451,8 +453,6 @@ test('@mdx-js/esbuild', async (t) => {
})

await t.test('should compile from `pluginData.content`', async () => {
console.log('\nnote: the preceding errors and warnings are expected!\n')

await esbuild.build({
entryPoints: [fileURLToPath(new URL('esbuild.mdx', import.meta.url))],
outfile: fileURLToPath(
Expand Down

1 comment on commit 57ebce5

@vercel
Copy link

@vercel vercel bot commented on 57ebce5 Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mdx – ./

mdxjs.com
mdx-mdx.vercel.app
mdx-git-main-mdx.vercel.app
v2.mdxjs.com

Please sign in to comment.