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.

Power-assert graph incomplete

See original GitHub issue

Description

Power assertions with Ava outputs incomplete graphs.

Test Source

test('A test', t =>{
    const arr = ['foo', 'bar'];
    t.true(arr.indexOf('moo') !== -1);
});

Expected assertion output

t.true(arr.indexOf('moo') !== -1)
         |   |              |   |
         |   |              |   -1
         |   -1             false
         ["foo","bar"]

Note: This is the output you get from using power-assert directly in something like mocha.

Actual assertion output

t.true(arr.indexOf('moo') !== -1)
             |
             -1

Config

Copy the relevant section from package.json:

{
  "ava": {
    "files": [
      "test.js"
    ]
  }
}

Command-Line Arguments

Copy your npm build scripts or the ava command used:

ava

Environment

Node.js: v6.9.1 OS: darwin 15.6.0 ava: 0.16.0 yarn: 0.15.1 - Used for installing packages in my project npm: 3.10.8

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
sindresorhuscommented, Oct 22, 2016

@twada I would definitely want to see the array value with the SuccinctRenderer. Just seeing -1 isn’t very useful.

@jyboudreau The verbose one is too verbose. We try to strike a balance. In this case, ours was too minimal.

0reactions
novemberborncommented, Sep 3, 2017

We now print all values through our formatter, so this issue is no longer applicable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Power-assert: Power Assert in JavaScript - Morioh
What is power-assert? is an implementation of "Power Assert" concept in JavaScript. see slides: ... Incomplete increment/decrement assertion messages?
Read more >
Readable, Writable Test Assertions for .NET - GitHub
Looking into collections ... PowerAssert will cause a failure with the following message: System.Exception : IsTrue failed, expression was: list.Where(l => ((l % ......
Read more >
node_modules/power-assert ... - GitLab
is an implementation of "Power Assert" concept in JavaScript. provides descriptive assertion messages ... Incomplete increment/decrement assertion messages?
Read more >
ObjectGraphBuilder.DefaultNewInstanceResolver (Groovy 1.7.0)
Create a new instance of Class klass. Specified by: newInstance in interface ObjectGraphBuilder.NewInstanceResolver. Parameters: klass - the resolved ...
Read more >
Spock Framework Reference Documentation
Spock is a testing and specification framework for Java and Groovy applications. What makes it stand out from the crowd is its beautiful...
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