All files internalError.spec.ts

100% Statements 25/25
100% Branches 0/0
100% Functions 10/10
100% Lines 15/15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271x 1x   1x   1x     4x   1x 1x 1x 1x     1x     4x   1x 1x 1x 1x    
import { suite, test } from 'mocha-typescript';
import { expect } from 'chai';
 
import { InternalError } from './internalError';
 
@suite class InternalErrorDefaults {
    public error: InternalError;
 
    before() { this.error = new InternalError(); }
 
    @test name() { expect(this.error.name).to.equal('InternalError'); }
    @test type() { expect(this.error.type).to.equal('internal_error'); }
    @test message() { expect(this.error.message).to.equal('Internal Server Error'); }
    @test status() { expect(this.error.status).to.equal(500); }
}
 
@suite class InternalErrorCustom {
    public error: InternalError;
 
    before() { this.error = new InternalError('custom message', 999); }
 
    @test name() { expect(this.error.name).to.equal('InternalError'); }
    @test type() { expect(this.error.type).to.equal('internal_error'); }
    @test message() { expect(this.error.message).to.equal('custom message'); }
    @test status() { expect(this.error.status).to.equal(999); }
}