Skip to content

Commit ee10977

Browse files
wesleychodignifiedquire
authored andcommitted
feat(api): add constants to the public api
Make `constants` available for public usage. Fixes #2361
1 parent 3d94b8c commit ee10977

2 files changed

Lines changed: 51 additions & 0 deletions

File tree

docs/dev/04-public-api.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,56 @@ const path = require('path');
148148
const karmaConfig = cfg.parseConfig(path.resolve('./karma.conf.js'), { port: 1337 } );
149149
```
150150

151+
## karma.constants
152+
153+
### **constants.VERSION**
154+
155+
The current version of karma
156+
157+
### **constants.DEFAULT_PORT**
158+
159+
The default port used for the karma server
160+
161+
### **constants.DEFAULT_HOSTNAME**
162+
163+
The default hostname used for the karma server
164+
165+
### **constants.LOG_DISABLE**
166+
167+
The value for disabling logs
168+
169+
### **constants.LOG_ERROR**
170+
171+
The value for the log `error` level
172+
173+
### **constants.LOG_WARN**
174+
175+
The value for the log `warn` level
176+
177+
### **constants.LOG_INFO**
178+
179+
The value for the log `info` level
180+
181+
### **constants.LOG_DEBUG**
182+
183+
The value for the log `debug` level
184+
185+
### **constants.COLOR_PATTERN**
186+
187+
The default color pattern for log output
188+
189+
### **constants.NO_COLOR_PATTERN**
190+
191+
The default pattern for log output without color
192+
193+
### **constants.CONSOLE_APPENDER**
194+
195+
The default console appender
196+
197+
### **constants.EXIT_CODE**
198+
199+
The exit code
200+
151201
## Callback function notes
152202

153203
- If there is an error, the error code will be provided as the second parameter to the error callback.

lib/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var oldServer = {
2020
}
2121

2222
module.exports = {
23+
constants: constants,
2324
VERSION: constants.VERSION,
2425
Server: Server,
2526
runner: runner,

0 commit comments

Comments
 (0)