Sha256: e82d72dca7d84a68713d28e1cf79a8a6f260eef5243369e4c0f4073aa700cbf6

Contents?: true

Size: 892 Bytes

Versions: 7

Compression:

Stored size: 892 Bytes

Contents

var createError = require('../../../lib/util/createError');
var expect = require('expect.js');

describe('createError', function () {

    beforeEach(function () {
        this.err = createError('message', 500);
    });

    describe('requiring the createError module', function () {

        it('should expose a createError method', function () {
            expect(typeof createError === 'function').to.be.ok;
        });

    });

    describe('invoking createError', function () {

        it('should return a new Error Object', function () {
            expect(typeof createError() === 'object').to.be.ok;
        });

        it('should return an Error with message', function () {
            expect(this.err.message).to.eql('message');
        });

        it('should return an Error with code', function () {
            expect(this.err.code).to.eql(500);
        });

    });


});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/test/core/util/createError.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/test/core/util/createError.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/test/core/util/createError.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/test/core/util/createError.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/test/core/util/createError.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/test/core/util/createError.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/test/core/util/createError.js