andywer / andywer/leakage

Document best practices

Aberta
#19 6 comentários 0 reações 0 responsáveis Ver no GitHub
discussion help wanted improve documentation
Linguagem predominante
JavaScript
Estrelas
1.6k
Forks
36
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Here is a draft for what the *best practices* should contain. Follow-up of #18.

## Topics

### No console.log() on non-primitive values in tests

As @mjhea0 pointed out, the `console.*` methods will keep a reference to any object/array/function you pass them, thus artificially introducing a memory leak. See http://stackoverflow.com/a/28859493/1799408.

### Leakage tests are quite slow
... so think twice before running it together with your other tests everytime. Point out why they are quite slow (as in the FAQ/Timeouts). Ideally present alternatives.

### Make test fail first, then fix it
Similar to other kinds of test it is also best practice to first check that your leakage test actually works, by purposely introducing a leak and watching the test fail. Remove the initial leak again and make sure the test passes.

*(to be filled with additional content)*

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.