From ee10977ba6a87d40e76c41439c64aef7264caffa Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Wed, 7 Dec 2016 02:30:06 -0800 Subject: [PATCH] feat(api): add constants to the public api Make `constants` available for public usage. Fixes #2361 --- docs/dev/04-public-api.md | 50 +++++++++++++++++++++++++++++++++++++++ lib/index.js | 1 + 2 files changed, 51 insertions(+) diff --git a/docs/dev/04-public-api.md b/docs/dev/04-public-api.md index 980c1bebb..00e6d7528 100644 --- a/docs/dev/04-public-api.md +++ b/docs/dev/04-public-api.md @@ -148,6 +148,56 @@ const path = require('path'); const karmaConfig = cfg.parseConfig(path.resolve('./karma.conf.js'), { port: 1337 } ); ``` +## karma.constants + +### **constants.VERSION** + +The current version of karma + +### **constants.DEFAULT_PORT** + +The default port used for the karma server + +### **constants.DEFAULT_HOSTNAME** + +The default hostname used for the karma server + +### **constants.LOG_DISABLE** + +The value for disabling logs + +### **constants.LOG_ERROR** + +The value for the log `error` level + +### **constants.LOG_WARN** + +The value for the log `warn` level + +### **constants.LOG_INFO** + +The value for the log `info` level + +### **constants.LOG_DEBUG** + +The value for the log `debug` level + +### **constants.COLOR_PATTERN** + +The default color pattern for log output + +### **constants.NO_COLOR_PATTERN** + +The default pattern for log output without color + +### **constants.CONSOLE_APPENDER** + +The default console appender + +### **constants.EXIT_CODE** + +The exit code + ## Callback function notes - If there is an error, the error code will be provided as the second parameter to the error callback. diff --git a/lib/index.js b/lib/index.js index 4cf7a8bfb..9d09178b0 100644 --- a/lib/index.js +++ b/lib/index.js @@ -20,6 +20,7 @@ var oldServer = { } module.exports = { + constants: constants, VERSION: constants.VERSION, Server: Server, runner: runner,