Created
March 19, 2020 12:49
-
-
Save wingyplus/0858a11f7ab2009c567d645900d442a6 to your computer and use it in GitHub Desktop.
LIFF wrapper with automatical replace when running under Cypress
This file contains hidden or 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
/* eslint-disable no-undef */ | |
// replaced liff when running in cypress sandbox | |
if (window.cy) { | |
console.log('liff: running in cypress sandbox') | |
window.liff = window.cy.liff | |
} | |
export default { | |
init() { | |
return new Promise((resolve, reject) => | |
liff.init( | |
() => resolve(), | |
(err) => reject(err) | |
) | |
) | |
}, | |
getProfile() { | |
return liff.getProfile() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment