Permalink
Browse files

Add module exports Babel module and test CommonJS compatibility

  • Loading branch information...
1 parent 9bf9545 commit 35cbc6dba937085cfb5178c6db5fa4b37a08f625 @daffl daffl committed Feb 16, 2016
Showing with 12 additions and 3 deletions.
  1. BIN .DS_Store
  2. +2 −1 .babelrc
  3. +1 −0 package.json
  4. +2 −2 src/index.js
  5. +7 −0 test/src/index.test.js
View
Binary file not shown.
View
@@ -1,3 +1,4 @@
{
- "presets": [ "es2015" ]
+ "plugins": [ "add-module-exports" ],
+ "presets": [ "es2015" ]
}
View
@@ -56,6 +56,7 @@
"async": "^1.4.2",
"babel-cli": "^6.1.18",
"babel-core": "^6.1.21",
+ "babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015": "^6.1.18",
"body-parser": "^1.9.0",
"feathers": "2.0.0-pre.4",
View
@@ -14,7 +14,7 @@ const PROVIDERS = {
local
};
-export default function(providers) {
+export default function auth(providers) {
return function() {
const app = this;
let _super = app.setup;
@@ -101,4 +101,4 @@ export default function(providers) {
};
}
-export { hooks };
+auth.hooks = hooks;
@@ -0,0 +1,7 @@
+const assert = require('assert');
+
+describe('<%= name %>', () => {
+ it('is CommonJS compatible', () => {
+ assert.equal(typeof require('../../lib'), 'function');
+ });
+});

0 comments on commit 35cbc6d

Please sign in to comment.