Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve elm compiler error output #7994

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/core/integration-tests/test/elm.js
Expand Up @@ -7,6 +7,7 @@ import {
run,
outputFS,
} from '@parcel/test-utils';
import {normalizePath} from '@parcel/utils';

describe('elm', function () {
it('should produce a basic Elm bundle', async function () {
Expand Down Expand Up @@ -83,6 +84,10 @@ describe('elm', function () {
});

it('should produce correct formatting and indentation when compilation fails', async function () {
const normalizedPath = normalizePath(
'test/integration/elm-compile-error/src/Main.elm',
false,
);
mischnic marked this conversation as resolved.
Show resolved Hide resolved
await assert.rejects(
() =>
bundle(path.join(__dirname, 'integration/elm-compile-error/index.js'), {
Expand All @@ -95,7 +100,7 @@ describe('elm', function () {
{
message:
'\n' +
'-- TYPE MISMATCH --------------- test/integration/elm-compile-error/src/Main.elm\n' +
`-- TYPE MISMATCH --------------- ${normalizedPath}\n` +
'\n' +
'The 1st argument to `text` is not what I expect:\n' +
'\n' +
Expand All @@ -116,7 +121,7 @@ describe('elm', function () {
{
message:
'\n' +
'-- TOO MANY ARGS --------------- test/integration/elm-compile-error/src/Main.elm\n' +
`-- TOO MANY ARGS --------------- ${normalizedPath}\n` +
'\n' +
'The `text` function expects 1 argument, but it got 2 instead.\n' +
'\n' +
Expand Down