question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests for various challenges are too strict about line breaks before method calls (part 2)

See original GitHub issue

Not all of the challenges listed in #35090 were fixed by #35093. This issue is for the remaining challenges that the aforementioned PR did not modify.

The problem

The tests for various challenges are too strict about line breaks before method calls.

E.g. something like this passes:

document.getElementById( 'getMessage' )
      .onclick = function() {};

But this causes the tests to fail:

document
      .getElementById( 'getMessage' )
      .onclick = function() {};

Affected challenges

console.log(
  json[2]
    .codeNames[1]
);
if ( navigator.geolocation ) {
  navigator.geolocation.getCurrentPosition(
    pos => {
      document.getElementById( 'data' )
        .innerHTML =
          'latitude: ' +
          position.coords.latitude +
          '<br />longitude' +
          position.coords.longitude;
      }
    );
}

Browser and OS info

  • Browser Name: Firefox Developer Edition
  • Browser Version: 66.0b9
  • Operating System: Antergos Linux

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
RandellDawsoncommented, Feb 23, 2019

I have asked @ValeraS who has a very solid understanding of what helper utilities to which we have access.

0reactions
RandellDawsoncommented, Feb 25, 2019

@Ensive We have concluded for now, we will have to write our own as they do not want to add another package to the library. I think we should actually consider how we can test these types of challenges without resorting to using regex. For example, we should be validating that the code written actual returns the correct JSON response. That is the true test. We might look for a few key methods with regex, but not complete lines of code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tests for various challenges are too strict about line breaks ...
The problem The tests for various challenges are too strict about line breaks before method calls. E.g. something like this passes: document ...
Read more >
Testing | SpringerLink
A lot is said about testing in information technology. There are three reasons for the attention testing has gained during the last decades:...
Read more >
Strict mode - JavaScript - MDN Web Docs
JavaScript's strict mode is a way to opt in to a restricted variant of JavaScript, thereby implicitly opting-out of "sloppy mode".
Read more >
If you break long code lines, how do you indent the stuff on the ...
I like braces on their own line because I fine it easier to see the condition and inner block all as one item...
Read more >
csv remove line breaks
How to remove the line break on csv file? 1. r remove all string before Python, Remove new line from CSV file. To...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found