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

The inspect documentation is missing #148

Open
xpe opened this issue Jan 21, 2017 · 4 comments
Open

The inspect documentation is missing #148

xpe opened this issue Jan 21, 2017 · 4 comments

Comments

@xpe
Copy link

xpe commented Jan 21, 2017

On http://chaijs.com/api/plugins/, the sidebar includes 'inspect'. However, that section does not have a section heading like the others. It only shows this:

Echos the value of a value. Trys to print the value out in the best way possible given the different types.

@param { Object } obj The object to print out.
@param { Boolean } showHidden Flag that shows hidden (not enumerable) properties of objects.
@param { Number } depth Depth in which to descend in object. Default is 2.
@param { Boolean } colors Flag to turn on ANSI escape codes to color the output. Default is false (no coloring).
@aaronsofaly
Copy link
Contributor

Hi @xpe, nice catch!

The docs are generated from the chai.js repo. If you want, you can submit a pull request to the chai.js repo which adds the headline.

It looks like this is the file that needs updating, https://github.com/chaijs/chai/blob/master/lib/chai/utils/inspect.js.

You could fix it with this:

/**
 * ### .inspect (obj, showHidden, depth, colors)
 *
 * Echoes the value of a value. Tries to print the value out
 * in the best way possible given the different types.
 *
 * @param {Object} obj The object to print out.
 * @param {Boolean} showHidden Flag that shows hidden (not enumerable)
 *    properties of objects.
 * @param {Number} depth Depth in which to descend in object. Default is 2.
 * @param {Boolean} colors Flag to turn on ANSI escape codes to color the
 *    output. Default is false (no coloring).
 * @namespace Utils
 * @name inspect
 */

Looking at that plugins page, it looks like some of the items have the wrong headline element. They're using h1's instead of h3's.

So you could make additional fixes.

Change https://github.com/chaijs/chai/blob/master/lib/chai/utils/addLengthGuard.js#L12 to:

* ### addLengthGuard(fn, assertionName, isChainable)

Change https://github.com/chaijs/chai/blob/master/lib/chai/utils/getActual.js#L8 to:

* ### getActual(object, [actual])

Change https://github.com/chaijs/chai/blob/master/lib/chai/utils/isProxyEnabled.js#L10 to:

* ### isProxyEnabled()

Change https://github.com/chaijs/chai/blob/master/lib/chai/utils/proxify.js#L13 to:

* ### proxify(object)

Change https://github.com/chaijs/chai/blob/master/lib/chai/utils/test.js#L14 to:

* ### test(object, expression)

@xpe
Copy link
Author

xpe commented Jan 22, 2017

Thanks for the detailed look and response.. For now, I just have time to report the issue. (I don't use Chai.) I was helping someone else who was looking at it.

@aaronsofaly
Copy link
Contributor

Okay, no problem!

@keithamus, want me to open a PR?

@keithamus
Copy link
Member

For sure @aaronsofaly, sounds great! Look forwarding to merging it 😄

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

3 participants