• WTFGuy (unregistered)

    Frist! You say

    They wrote a test they didn't understand for code they didn't understand, but at least the test would always pass.

    As if that was a bad thing. Clearly you don't understand management's metrics for test performance. Management almost always gets wheat they ask for. Even if it isn't what they want or should want.

    They want a test for each function and want that test to pass. All else is fluff outside your lane.

    By that standard I call this a rousing success.

  • (nodebb)

    Nobody expects the Spanish 3

  • Sauron (unregistered)

    expect(WTF)

  • (nodebb)

    For 3 months I consulted at a major financial firm where 80% of the unit tests had no 'expect' at all. Management looked at a 'coverage' report number for the project, but didn't care if the coverage was real. The expect(3) is different, but the rest of this WTF looks very similar to that project.

  • Anonymous (unregistered)

    Is this a testing library where expect(3) means "expect this test to contain 3 assertions"?

    I've seen this once or twice in JavaScript for testing callbacks, where you want the test to fail if the callback with the assertion in it doesn't get called.

  • (nodebb)

    "New rule: all code must be submitted with passing tests" said the manager following the last deployment disaster.

    Copy paste some random other previous test.

    Done.

  • (nodebb) in reply to Anonymous

    Is this a testing library where expect(3) means "expect this test to contain 3 assertions"?

    More likely it wants a truthy/falsey value, and explodes if the value is falsey. 3 is truthy, so everything is reported as just peachy.

  • LZ79LRU (unregistered) in reply to Steve_The_Cynic

    I like the words truthy and falsey. Although I think I'd probably spell the latter as falsy. Also I prefer the later to the former anyway. Truthy sounds too much like a sort of tooth. Where as falsy sounds like what you'd say to a small child when explaining why you lied. "What I said is only kind of falsy little Timmy."

  • Tim R (unregistered) in reply to LZ79LRU

    truthy and falsy are official not just whimsical terms; they are official Javascript nomenclature https://developer.mozilla.org/en-US/docs/Glossary/Truthy

  • LZ79LRU (unregistered) in reply to Tim R

    But you are not denying that they are in fact whimsical and more than a tad amusing.

  • (nodebb)

    Huh. I'm used to expect(1) rather than expect(3).

  • (nodebb)

    Why does lispParser parse b as {"function": "b", "arguments": []}? It's not a function call, that would be (a (b)).

  • Duke of New York (unregistered) in reply to Anonymous

    It's Jasmine, or something like it, so "expect" creates an assertion subject that is supposed to be followed by an assertion predicate, but isn't.

    This raises the question of why Jasmine doesn't track the subjects created in a case and verify that all of them had predicates. "People can just read the docs." That's a good one, tell me another.

  • (nodebb) in reply to LZ79LRU

    You young punks! "Falsy" specifically refers to a woman's brassiere with a thick layer or two to artificially enhance apparent bosom size.

  • (nodebb) in reply to cellocgw

    I thought that was a falsie...

  • Foo AKA Fooo (unregistered) in reply to Barry Margolin

    Actually (a b) is a function call, corresponding to a(b) in C. (a (b)) would be a(b()).

  • Gabe (unregistered)

    So what you're saying is that they didn't break the build.

    I see a great future.

  • mihi (unregistered) in reply to WTFGuy

    That is why you should use the https://github.com/auchenberg/volkswagen library in your code :)

  • Fera (unregistered)

    "So we start by expecting 3. Which, uh, usually the expect function starts a series of assertions, like we expect(returnValue).toBe(3). Here, we just expect three. Nothing about three, we just expect it." Ok I did not see this testing framework before so after reading this line, I started laughing like a maniac.

  • BaT (unregistered)

    So we start by expecting 3. Which, uh, usually the expect function starts a series of assertions, like we expect(returnValue).toBe(3). Here, we just expect three. Nothing about three, we just expect it.

    Except QUnit uses expect(amount) to specify how many assertions are expected in a test. It's usually used when testing asynchronous code, it's not so useful here, so it's still a WTF.

Leave a comment on “Testing with a Lisp”

Log In or post as a guest

Replying to comment #:

« Return to Article