Skip to content

Commit

Permalink
Merge pull request #420 from cmotsn/replace-debug-package
Browse files Browse the repository at this point in the history
Replace `debug` package by node:util.debuglog. Fixes #353
  • Loading branch information
tomas authored Dec 8, 2023
2 parents 747522b + a0a8702 commit d3ec179
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,11 @@ To run tests, you need to generate a self-signed SSL certificate in the `test` d
$ openssl req -new -key test/keys/ssl.key -x509 -days 999 -out test/keys/ssl.cert

Then you should be able to run `npm test` once you have the dependencies in place.
To run the tests with debug logs, set the environment variable `NODE_DEBUG` to `needle` (for example, by running `NODE_DEBUG=needle npm test`).

> Note: Tests currently only work on linux-based environments that have `/proc/self/fd`. They *do not* work on MacOS environments.
> You can use Docker to run tests by creating a container and mounting the needle project directory on `/app`
> `docker create --name Needle -v /app -w /app -v /app/node_modules -i node:argon`
> `docker create --name Needle -v $(pwd) -w /app -v $(pwd)/node_modules -i node:argon`
Credits
-------
Expand Down
2 changes: 1 addition & 1 deletion lib/needle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var fs = require('fs'),
https = require('https'),
url = require('url'),
stream = require('stream'),
debug = require('debug')('needle'),
debug = require('util').debuglog('needle'),
stringify = require('./querystring').build,
multipart = require('./multipart'),
auth = require('./auth'),
Expand Down
8 changes: 0 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"url": "https://github.com/tomas/needle.git"
},
"dependencies": {
"debug": "^3.2.6",
"iconv-lite": "^0.6.3",
"sax": "^1.2.4"
},
Expand Down

0 comments on commit d3ec179

Please sign in to comment.