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
{ | |
"name": "jest", | |
"version": "1.0.0", | |
"main": "sum.js", | |
"repository": "[email protected]:87a5d1b26cf2becc5d826d224c5b13f0.git", | |
"author": "EdgarJRG <[email protected]>", | |
"license": "MIT", | |
"scripts": { | |
"test": "jest" | |
}, |
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
init: | |
brew install yarn | |
yarn init |
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
instalar_yarn: | |
brew install yarn | |
iniciar_yarn: | |
yarn init | |
instalar_packetes_basicos: | |
yarn add koa koa-bodyparser koa-router | |
todos: |
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
compose = docker-compose -f ./docker-compose.yml | |
apps-up: | |
${compose} up ${app} | |
apps-up-bg: | |
${compose} up -d ${app} | |
apps-down: | |
${compose} down ${app} |
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
jest_desde_cero: | |
rm -rf ./jest | |
mkdir jest | |
cd ./jest && \ | |
git clone https://gist.github.com/87a5d1b26cf2becc5d826d224c5b13f0.git . && \ | |
yarn install --prefer-offline && \ | |
npx jest --init && \ | |
yarn test |
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 { lens } from './lens'; | |
test('adds 1 + 2 to equal 3', () => { | |
const unique = Symbol('nested') | |
expect(lens({ | |
some: { | |
nested: { | |
value: unique | |
} | |
} |
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
function double_every_element(numbers: number[]) { | |
let result: number[] = []; | |
for (let i = 0; i < numbers.length; i++) { | |
result.push(2 * numbers[i]) | |
} | |
return result; | |
} |
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 { double_every_element } from './double_every_element' | |
test('double every element', () => { | |
expect(double_every_element([1, 2, 3])).toEqual([2, 4, 6]) | |
}) |
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 { sum_of_every_element } from './sum_of_every_element' | |
test('calculate the sum of all elements using reduce', () => { | |
expect(sum_of_every_element([1, 2, 3])).toEqual(6) | |
}) |
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 { double_sum2_to_string } from './compose' | |
test('stringify after add 2 after double', () => { | |
expect(double_sum2_to_string([1, 2, 3])).toEqual(['4', '6', '8']) | |
}) |
OlderNewer