Skip to content

Commit

Permalink
feat(api): add constants to the public api
Browse files Browse the repository at this point in the history
Make `constants` available for public usage.

Fixes #2361
  • Loading branch information
wesleycho authored and dignifiedquire committed Dec 7, 2016
1 parent 3d94b8c commit ee10977
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
50 changes: 50 additions & 0 deletions docs/dev/04-public-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var oldServer = {
}

module.exports = {
constants: constants,
VERSION: constants.VERSION,
Server: Server,
runner: runner,
Expand Down

0 comments on commit ee10977

Please sign in to comment.