Jest Mock Any Property on Window Utility - with automatic cleanup.
This file contains 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 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 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 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 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 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