Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default export for auth0js #803

Merged
merged 1 commit into from
Jul 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"scripts": {
"start": "rollup -c --watch",
"build": "rm -rf dist && rm -rf build && rollup -c --prod && cp -rf dist build",
"test": "cross-env BABEL_ENV=test mocha --require babel-register test/**/*.test.js --exit",
"test": "cross-env BABEL_ENV=test mocha --require babel-register test/*.test.js test/**/*.test.js --exit",
"test:integration": "cross-env BABEL_ENV=test mocha-parallel-tests --compilers babel-register --max-parallel 2 integration/**/*.test.js",
"test:watch": "npm run test -- --watch -R min",
"ci:test": "cross-env BABEL_ENV=test nyc npm run test -- --forbid-only -R mocha-multi --reporter-options spec=-,mocha-junit-reporter=-",
Expand Down
7 changes: 7 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ import WebAuth from './web-auth';
import version from './version';

export { Authentication, Management, WebAuth, version };

export default {
Authentication: Authentication,
Management: Management,
WebAuth: WebAuth,
version: version
};
24 changes: 24 additions & 0 deletions test/imports-test.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import expect from 'expect.js';

import * as auth0 from '../src/index';
import auth0Default from '../src/index';

describe('Exports the correct objects', () => {
it('should export raw objects', () => {
expect(Object.keys(auth0)).to.be.eql([
'Authentication',
'Management',
'WebAuth',
'version',
'default'
]);
});
it('should export default object', () => {
expect(Object.keys(auth0Default)).to.be.eql([
'Authentication',
'Management',
'WebAuth',
'version'
]);
});
});