From 87d2cb98fc3a1f2adf0befa54a615437ece58838 Mon Sep 17 00:00:00 2001 From: Jinho Bang Date: Thu, 17 Jan 2019 09:02:23 +0900 Subject: [PATCH] Introduce new build targets for debugging purpose In this project, we can use the following command to test examples. $ npm test It might be very inefficient, especially, if the number of files increases. So, this patch introduces new build targets for debugging purpose as follows: $ npm run-script dev # Build with --debug option $ npm run-script dev:incremental # Incremental dev build This idea comes from @DaAitch. --- README.md | 14 ++++++++++++++ package.json | 2 ++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 4f6a4431d..bb080b241 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,20 @@ npm install npm test --disable-deprecated ``` +### **Debug** + +To run the **node-addon-api** tests with `--debug` option: + +``` +npm run-script dev +``` + +If you want faster build, you might use the following option: + +``` +npm run-script dev:incremental +``` + Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/master/test)** diff --git a/package.json b/package.json index cd313a30c..33952cb78 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,8 @@ "scripts": { "pretest": "node-gyp rebuild -C test", "test": "node test", + "dev": "node-gyp rebuild -C test --debug && node test", + "dev:incremental": "node-gyp configure build -C test --debug && node test", "doc": "doxygen doc/Doxyfile" }, "version": "1.6.2"