Skip to content

Instantly share code, notes, and snippets.

Avatar
🕳️
Law & Order, All lives matter

Eric calidion

🕳️
Law & Order, All lives matter
View GitHub Profile
@calidion
calidion / custom-error.js
Created Jul 10, 2016 — forked from justmoon/custom-error.js
Creating custom Error classes in Node.js
View custom-error.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);
@calidion
calidion / login.test.js
Created May 1, 2016 — forked from joaoneto/login.test.js
Login session test with mocha
View login.test.js
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')
You can’t perform that action at this time.