Repository navigation
feat: Return namespaces string when invoking disable() - #624
Conversation
1 similar comment
|
Let me add test cases if you want and if you are okay with the implementation so we can get the coverage up again :) |
b828357 to
ac5a726
Compare
|
Sure, this is fine. :) Yes to test cases, please. |
|
They were added already ac5a726#diff-1dd241c4cd3fd1dd89c570cee98b79ddR85 But spotting a spelling error. Will just correct it. |
ac5a726 to
1844758
Compare
|
Fixed |
|
It might seem redundant but can you add a few tests that test passing the returned string back to |
1844758 to
99765cc
Compare
|
I added a test of using enable. I'm using the The initial |
| expect(namespaces).to.equal('test,abc*,-abc'); | ||
| debug.enable(namespaces); | ||
| expect(oldNames.map(String)).to.deep.equal(debug.names.map(String)); | ||
| expect(oldSkips.map(String)).to.deep.equal(debug.skips.map(String)); |
There was a problem hiding this comment.
They are RegExp objects, so they are not the same even though the regular expression is the same. Mapping to their string representation will make the chai deep equal happy.
|
Last thing: could you add a bit of documentation to the readme? |
feat: Add unit tests for disable return value fix: Correct spelling in test case description feat: Test that disable-string works with enable again Closes debug-js#523 docs: Add section about disable return value
99765cc to
692b107
Compare
|
There you go! |
|
Thank you again :) I'll get this released shortly. |
PR for feature request #523
I thought about adding a new property
createDebugwhich would hold the untouched string passed toenablebut decided against it and instead let the disable deal with what it has:names,skips.Let me know if you prefer adding an untouched namespaces string to createDebug instead or you any other changes.
Closes #523
ps: Happy Hacktoberfest