Skip to content

Commit

Permalink
Expose util.logger
Browse files Browse the repository at this point in the history
  • Loading branch information
kumar303 committed Aug 3, 2017
1 parent fbba629 commit 5200ea8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/* @flow */
import {main} from './program';
import cmd from './cmd';
import * as logger from './util/logger';

export default {main, cmd};
// This only exposes util/logger so far.
// Do we need anything else?
const util = {logger};

export default {main, cmd, util};
5 changes: 5 additions & 0 deletions tests/unit/test.web-ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import webExt from '../../src/main';
import build from '../../src/cmd/build';
import run from '../../src/cmd/run';
import {main} from '../../src/program';
import {consoleStream} from '../../src/util/logger';


describe('webExt', () => {
Expand All @@ -18,4 +19,8 @@ describe('webExt', () => {
assert.equal(webExt.cmd.run, run);
assert.equal(webExt.cmd.build, build);
});

it('gives you access to the log stream', () => {
assert.equal(webExt.util.logger.consoleStream, consoleStream);
});
});

0 comments on commit 5200ea8

Please sign in to comment.