Skip to content

Commit 57ebce5

Browse files
authored
Refactor to silence checked esbuild error messages
Closes GH-2329. Reviewed-by: Christian Murphy <[email protected]> Reviewed-by: Titus Wormer <[email protected]>
1 parent d2ce50f commit 57ebce5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/esbuild/test/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ test('@mdx-js/esbuild', async (t) => {
139139
await fs.writeFile(new URL('esbuild.md', import.meta.url), 'a')
140140
await fs.writeFile(new URL('esbuild.mdx', import.meta.url), 'a')
141141

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

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

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

179178
await assert.rejects(
180179
esbuild.build({
180+
logLevel: 'silent',
181181
entryPoints: [
182182
fileURLToPath(new URL('esbuild-broken.mdx', import.meta.url))
183183
],
@@ -219,6 +219,7 @@ test('@mdx-js/esbuild', async (t) => {
219219

220220
await assert.rejects(
221221
esbuild.build({
222+
logLevel: 'silent',
222223
entryPoints: [
223224
fileURLToPath(new URL('esbuild-warnings.mdx', import.meta.url))
224225
],
@@ -392,6 +393,7 @@ test('@mdx-js/esbuild', async (t) => {
392393

393394
await assert.rejects(
394395
esbuild.build({
396+
logLevel: 'silent',
395397
entryPoints: [
396398
fileURLToPath(new URL('esbuild-plugin-crash.mdx', import.meta.url))
397399
],
@@ -451,8 +453,6 @@ test('@mdx-js/esbuild', async (t) => {
451453
})
452454

453455
await t.test('should compile from `pluginData.content`', async () => {
454-
console.log('\nnote: the preceding errors and warnings are expected!\n')
455-
456456
await esbuild.build({
457457
entryPoints: [fileURLToPath(new URL('esbuild.mdx', import.meta.url))],
458458
outfile: fileURLToPath(

0 commit comments

Comments
 (0)