Skip to content

Commit

Permalink
Fix #31
Browse files Browse the repository at this point in the history
- add spec "plugin should export to module.exports(#31)"
  • Loading branch information
59naga committed Apr 26, 2016
1 parent 83d975c commit 8471534
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import babelTemplate from 'babel-template'

export default {
module.exports = {
visitor: {
Program: {
exit (path) {
Expand Down
6 changes: 6 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ describe('babel-plugin-add-module-exports', () => {
assert(module.default === 'default-entry')
}))

it('plugin should export to module.exports(#31)', () => {
const plugin = require('../lib')
assert(typeof plugin === 'object')
assert(typeof plugin.visitor === 'object')
})

it('should handle duplicated plugin references (#1)', () =>
heplers.testPlugin(testCases[0].code, {
presets: ['es2015'],
Expand Down

0 comments on commit 8471534

Please sign in to comment.