Skip to content

Commit

Permalink
Some tests expect esbuild errors
Browse files Browse the repository at this point in the history
These errors are asserted. There is no need to log them.
  • Loading branch information
remcohaszing committed Jul 17, 2023
1 parent d2ce50f commit 004e5b8
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

0 comments on commit 004e5b8

Please sign in to comment.