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
| { | |
| "talks": [ | |
| { | |
| "title": "Unit Testing Front-end Code", | |
| "url": "https://www.youtube.com/watch?v=VSXGu73MiPg", | |
| "author": "Michael Jasper" | |
| }, | |
| { | |
| "title": "Testing Front-end Code the Right Way", | |
| "url": "https://www.youtube.com/watch?v=zF1hlOxucHE", |
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
| const { fromEvent } = Rx; | |
| const { map, pluck } = RxOperators; | |
| const input = document.createElement('input'); | |
| const container = document.querySelector('.container'); | |
| container.appendChild(input) | |
| const observable = fromEvent(input, 'input') | |
| .pipe( | |
| //map(event => event.target.value), |
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
| const firstLetterUpperCase = str => | |
| str.replace(/(^\w)/, m => m.toUpperCase()); | |
| const firstLetterLowerCase = str => | |
| str.replace(/(^\w)/, m => m.toLowerCase()); | |
| const toString = value => | |
| Object.prototype.toString.call(value); | |
| const isType = (type, value) => |
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
| # Front-end | |
| npm i -D jest husky lint-staged standard rollup babel-jest @babel/core @babel/preset-env @commitlint/config-conventional @commitlint/cli | |
| # babel.config.js | |
| ``` | |
| module.exports = { | |
| presets: [ | |
| [ | |
| '@babel/preset-env' | |
| ], |
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
| pex.add({ | |
| name: 'Accordion', | |
| init: (_elements, options) => { | |
| const elements = Array.from(_elements); | |
| // tools | |
| const isTitle = target => target.classList.contains('accordion__title'); | |
| const isOpen = target => target.classList.contains('accordion--open'); |
OlderNewer