摘要:
What we want to do is checking if user write nested if statements which actually can combine to one: Notice that if statement can write with block sta 阅读全文
摘要:
We want to write a Babel Plugin, which move 'const versionRegex = /(/d+)\.(/d+)\.(/d+)/gi' out of function scope and put it into global scope. Code: A 阅读全文
摘要:
To write a simple Babel plugin, we can use http://astexplorer.net/ to help us. The plugin we want to write is: We want to trasnform the code which hig 阅读全文
摘要:
The advantage of RS256 over HS256 is RS256 no longer need to share the secret key between client and server side. To create a token, we need to privat 阅读全文
摘要:
Here we want to test a toggle button component, when the button was click, state should change, style should change also. Toggle component: Test: 阅读全文
摘要:
For example we have a React comonent: -- A toggle button, we want to test. When it si toggle on, the color is a little bit darken than it's not. Testi 阅读全文
摘要:
For intergration tests, always remember when you create a 'mass' you should aslo clean up the 'mass'. For example when you start the server, you need 阅读全文
摘要:
We have express app: As you can see, we wrap Express App into a function 'startServer' and export it as default export. The return value of this funct 阅读全文
摘要:
Stateful session management: Store session which associate with user, and store in the menory on server. Sign Up: Password validation: Random bytes ge 阅读全文