Jest Mock Any Property on Window Utility - with automatic cleanup.
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
# Repository or organization name | |
> Description | |
## Build Setup | |
``` bash | |
# install dependencies | |
npm install or yarn |
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
import React from 'react'; | |
import styled from 'styled-components'; | |
const Button = styled.a` | |
line-height: 2; | |
height: 5rem; | |
text-decoration: none; | |
display:inline-flex; | |
color: #FFFFFF; | |
background-color: #FF813F; |
Nesse teste, n贸s queremos que seja feita uma lista dos reposit贸rios com stars do Github onde para cada reposit贸rio selecionado seja poss铆vel adicionar um coment谩rio ao mesmo por usu谩rio, isso utilizando react, com uma api em rest ou graphql, o que 茅 esperado desse teste:
- Testes unit谩rios.
- Uso de Create React App.
- Que tenha autentica莽茫o para o acesso a aplica莽茫o e listagem do mesmo.
- Seja poss铆vel ver uma lista de reposit贸rios.
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
/* This is intentionally blank just and exists to secure a decent gist name */ |
Design an API that save game speedruns and serves a leaderboard.
In several games, finishing the game is deemed just too easy for some gamers, so they decide to see how fast they can finish the entire game. In fact, speedruns became so popular that many players compete with other players to see if they can break each other records, even if that means beating the time by just a couple of seconds. We want to create an API that can registers those records and also serve a leaderboard.
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
postgres: | |
image: postgres:14.6-alpine | |
ports: | |
- '5432:5432' | |
environment: | |
POSTGRES_USER: 'user' | |
POSTGRES_PASSWORD: 'password' | |
POSTGRES_DB: 'database' | |
volumes: | |
- ./init:/docker-entrypoint-initdb.d/ |
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
/* | |
* I saw this thread: http://stackoverflow.com/questions/840781/easiest-way-to-find-duplicate-values-in-a-javascript-array | |
* The solutions from gist:1305056 were elegant, but wrong. So here's mine: | |
*/ | |
Array.prototype.unique = function(test) { | |
/* returns a new, sorted Array without duplicates */ | |
if (!Array.isArray(this)) | |
throw new TypeError("Array.prototype.unique must be called on an Array"); | |
return this.slice(0).sort().filter( typeof test == "function" | |
? function(v, i, a) { return !i || !test(v, a[i-1]); } |
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
{ | |
"[astro]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[css]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[dockercompose]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, |
NewerOlder