Giter VIP home page Giter VIP logo

Comments (3)

brandenbyers avatar brandenbyers commented on May 1, 2024

Good point on the invisible variables. @terakilobyte, could we print out variables declared in the tests? I didn't realize they wouldn't be visible.

Otherwise, yes, we can make the assertions obvious. There is no need for them to be in variables.

from freecodecamp.

terakilobyte avatar terakilobyte commented on May 1, 2024

Looking at the json for this challenge revealed this.

"var numbers = [10, 20, 30, 40, 50], num = 35;",
"var indexForNum = where(numbers, num);",
"assert.equal(indexForNum, 3, '35 should be inserted at index 3');",
"var indexFor30 = where(numbers, 30);",
"assert.equal(indexFor30, 2, '30 should be inserted at index 2');"

If you mean print out the variables created as part of the test, no, there's no meaningful way to print those out separately. This bonfire needs to be rewritten to show the test case as part of the test, rather than whisking them away in a variable. I'll close this issue once I've done so.

from freecodecamp.

terakilobyte avatar terakilobyte commented on May 1, 2024

The challenge has been updated to be more descriptive, and the tests have been rewritten to use expect instead of assert. A style guide would be greatly useful (wink wink to one of you) specifying that all bonfires should have additional information and no tests should use assert as they become quite long with the output text where as it's built into expect/should.

from freecodecamp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.