…that prints the details of the test failure error as soon as a test fails.
Why? I hate having to wait until my long test suite finishes to begin debugging why a test fails.
CREATE EXTENSION IF NOT EXISTS uuid-ossp; | |
CREATE TABLE IF NOT EXISTS users ( | |
user_id uuid PRIMARY KEY DEFAULT uuid_generate_v1mc(), | |
email text UNIQUE, | |
password_hash text, | |
username text, | |
avatar_url text | |
); |
alert('🏂'); | |
alert('🏂'); | |
alert('🏂'); | |
alert('🏂'); |
const doSomething = (uniqueThing) => { | |
if (doSomething.currentRequest[uniqueThing]) { | |
return doSomething.currentRequest[uniqueThing] | |
} | |
return doSomething.currentRequest[uniqueThing] = require(url, params) | |
.then( | |
response => { | |
delete doSomething.currentRequest | |
return response |
const request = require('request-promise') | |
const getURL = (url) => { | |
console.log(`GET: ${url}`) | |
// request the URL as a GET requests | |
// parse the resonse using JSON.parse | |
} | |
const getPosts = () => { | |
return getURL('https://jsonplaceholder.typicode.com/posts') |
#!/usr/bin/env node | |
const fs = require('fs') | |
const Path = require('path') | |
const stateFilePath = Path.resolve(process.env.HOME, '.todo') | |
const command = process.argv[2] | |
const input = process.argv.slice(3).join(' ') | |
const getState = callback => { |
const numbers = [5,2,4,3,1] | |
const sorterA = (a,b) => { | |
if (a < b) return -1 | |
if (b < a) return 1 | |
return 0 | |
} | |
const sorterB = (a,b) => { | |
if (a < b) return 1 |
/* | |
expect([1,2,3]).to.not.haveDuplicates() | |
expect([1,1,2,3]).to.haveDuplicates() | |
*/ | |
chai.Assertion.addMethod('haveDuplicates', function() { | |
const array = Array.from(this._obj) | |
expect(array).to.be.an.instanceof(Array) |
### Keybase proof | |
I hereby claim: | |
* I am deadlyicon on github. | |
* I am deadlyicon (https://keybase.io/deadlyicon) on keybase. | |
* I have a public key ASCk6Mt98T-7ihYOEO3DjHFJRi7Irby6eTQ_92CH-YcCYAo | |
To claim this, I am signing this object: |
Use the following resources to level up your git skills.