Last active
November 17, 2016 10:40
-
-
Save sota1235/dae20076fb76ccd70493e4dfd2335284 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import proxyquire from 'proxyquire'; | |
import Button from 'lib/button'; | |
const Button = require('lib/button'); | |
const MockButton = proxyquire('lib/button', { | |
'lib/functions/browser-dependencies': { | |
windowLocationHref: 'mock href', | |
}, | |
}).default; | |
const button = new MockButton; | |
// export | |
export default class Button { | |
}; | |
// import | |
import Button frmo 'button'; | |
const Button = require('button'); // NG | |
const Button = require('button').default; // OK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment