Real unit test (isolation, no children render)
Calls:
- constructor
- render
| An execution plan has been generated and is shown below. | |
| Resource actions are indicated with the following symbols: | |
| + create | |
| Terraform will perform the following actions: | |
| <lots of information about the resources that Terraform is about to create> | |
| Plan: 15 to add, 0 to change, 0 to destroy. |
| provider "aws" { | |
| version = "~> 2.0" | |
| region = "eu-central-1" | |
| } | |
| # VPC | |
| resource "aws_vpc" "tf_vpc" { | |
| cidr_block = "10.0.0.0/16" | |
| tags = { |
| const assert = require('assert'); | |
| function solution(array) { | |
| const k = array.length / 4; | |
| let buffer = []; | |
| return flatten(array.reduce((a, b, i) => { | |
| buffer.push(b); | |
| if (b !== array[i + 1]) { | |
| a.push(buffer); | |
| buffer = []; |
| import { Injectable } from '@angular/core'; | |
| import { | |
| Http, | |
| ConnectionBackend, | |
| RequestOptions, | |
| RequestOptionsArgs, | |
| Response, | |
| Headers | |
| } from '@angular/http'; | |
| import { Observable } from 'rxjs/Observable'; |
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => { | |
| return [1, 2, 3]; |
| (function() { | |
| /* | |
| * LODASH in-Browser JSON transformer | |
| * Use this in a bookmarket (save its contents in a bookmark) and whenever you open a JSON response (e.g. https://www.reddit.com/.json) | |
| * you can use it to test lodash methods against the data. | |
| * Lodash is exposed on window as _ and "json" global variable contains the data within the browser window. | |
| * | |
| * Copy the line below and save it as the url of a new bookmark (it's the same code as below but minified for bookmark use): | |
| * javascript:!function(){function onScriptLoaded(){window.json=JSON.parse(JSON.stringify(initialJSONCode)),display(window.json),input.addEventListener("input",onInput),document.body.appendChild(input),document.body.appendChild(info)}function onInput(t){if(!t.target.value)return display(initialJSONCode),void setInputState(t.target,"success");var e=wrap(t.target.value);e&&"object"==typeof e?(setInputState(t.target,"success"),display(e)):setInputState(t.target,"error")}function display(t){pre.innerText?pre.innerText=J |
| javascript:!function(){var n,e,r,i;n=window,e=document.body,r=JSON.parse,i=JSON.stringify,n.isf||(e.innerHTML="<pre>"+i(r(e.innerText),null,4).replace(/\"(.*)[^\:]\:/g,'<span style="color:#9C3636">$1:</span>')+"</pre>",n.isf=!0)}(); | |
| //usage: | |
| //save as bookmark and click it whenever you open a json response in a browser tab/window |
| function get(obj, path) { | |
| let spl; | |
| return new Function( | |
| `return arguments[0]&&${(spl = path.split('.')).reverse().map((prop, index) => { | |
| return `arguments[0].${spl.slice(spl.length - index - 1).reverse().join('.')}`; | |
| }).join('&&')}`)(obj); | |
| } | |
| //usage: | |
| // const hello = {world:{foo:{bar:baz:1}}} |
| Object.defineProperty(location, 'searchJSON', { | |
| get: function() { | |
| var a = window.location, | |
| b = a.href.split('?'), | |
| c = a.search; | |
| return (c.slice(1) || (b.length > 1 && b[1]) || '').split("&").reduce(function(p, c) { | |
| return (c = c.split("=")) && (p[c[0]] = unescape(c[1])) && p | |
| }, {}) || {}; | |
| }, | |
| enumerable: false, |