Skip to content

Instantly share code, notes, and snippets.

View calidion's full-sized avatar
🕳️
Law & Order, All lives matter

Eric calidion

🕳️
Law & Order, All lives matter
View GitHub Profile
@calidion
calidion / login.test.js
Created May 1, 2016 01:25 — forked from joaoneto/login.test.js
Login session test with mocha
var request = require('supertest'),
should = require('should'),
app = require('../server');
var Cookies;
describe('Functional Test <Sessions>:', function () {
it('should create user session for valid user', function (done) {
request(app)
.post('/v1/sessions')
@calidion
calidion / custom-error.js
Created July 10, 2016 10:18 — forked from justmoon/custom-error.js
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);