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

Web runner: unable to read end of long lines in test results #1030

Closed
ArnaudBrousseau opened this issue Nov 8, 2013 · 0 comments
Closed

Comments

@ArnaudBrousseau
Copy link
Contributor

Steps to repro

  1. Clone latest mocha

  2. Create a simple failing test that has a long filename

    // (in sample_test_file_with_long_name_so_that_wrapping_behavior_is_apparent.js)
    describe('Dummy Test', function(){
        it('Should crash', function(){
            var a = 1;
            a['foo']();
        });
    });
    
  3. Load web runner

<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <title>Dummy Test</title>
    <link rel="stylesheet" href="mocha.css" />
</head>
<body>
    <div id="mocha"></div>
    <script src="mocha.js"></script>
    <script>mocha.setup('bdd')</script>

    <script src="sample_test_file_with_long_name_so_that_wrapping_behavior_is_apparent.js"></script>
    <script>mocha.run()</script>
</body>

Expected

You can see the filename/linenumber in which the crash occured

Actual

The fact that overflow:hidden is set on the container prevents you from seeing the end of lines
image

Proposed Fix

Let's set a max-width on the test result container and use the CSS rule word-wrap: break-word; to wrap lines if necessary.
image

I have a fix for this, but I thought I'd open an issue to be able to reference it in my commit. Expect a pull request soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant