Real unit test (isolation, no children render)
Calls:
- constructor
- render
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
Основное требование к финальным проектам - это небольшое SPA (Single Page Application) веб-приложение с опрятным и чистым дизайном. Желательно использование фреймворков типа React или Angular. Должна быть либо серверная часть на nodejs, либо использованы сторонние API и веб-сервисы для получения данных, то есть или свой или сторонний бекенд, чтобы попрактиковать ajax-запросы. Если бекенд свой, то в идеале его можно разместить на бесплатном клауд-хостинге (https://www.heroku.com/, https://www.firebase.com, https://www.openshift.com и тд), если нужна база mongodb то можно воспользоваться бесплатным вариантом на https://mlab.com/.
Ниже примерные типовые приложения, которые можно взять за основу, если нет своих идей. Картинки даны для примера дизайна, делать похожим один в один необязательно. Дизайн типичных приложений можно подсмотреть в google images.
{ | |
var a = 1, b = 0, temp; | |
while (num >= 0){ | |
temp = a; | |
a = a + b; | |
b = temp; | |
num--; | |
} |
// Promise.all is good for executing many promises at once | |
Promise.all([ | |
promise1, | |
promise2 | |
]); | |
// Promise.resolve is good for wrapping synchronous code | |
Promise.resolve().then(function () { | |
if (somethingIsNotRight()) { | |
throw new Error("I will be rejected asynchronously!"); |
Source mapping is a technique that "maps" your browser inspector's line numbers to the source file. This is useful when working with assets that are compiled from LESS, SASS, Coffeescript and so on. Source maps can also be used with minified assets that would normally have their line numbers removed. If you're curious, here's some more information regarding source maps.
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Box Shadow</title> | |
<style> | |
.box { | |
height: 150px; | |
width: 300px; | |
margin: 20px; |