All files / test errors.spec.js

100% Statements 11/11
100% Branches 0/0
100% Functions 6/6
100% Lines 11/11
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 27 28 29 30    1x 1x 3x     1x 3x     1x 1x         1x 1x         1x 1x          
'use strict';
 
describe("Errors", function() {
  beforeEach(function(done) {
    this.startServer({ dataPath: 'test/data/errors' }).then(done, done.fail);
  });
 
  afterEach(function(done) {
    this.stopServer().then(done, done.fail);
  });
 
  it('should return an error in case of an invalid JSON file', function(done) {
    this.checkPaths('GET', {
      'api/invalid_json': {status: 500},
    }).then(done, done.fail);
  });
 
  it('should return an error in case of .script found but mock file not found', function(done) {
    this.checkPaths('GET', {
      'api/no_mock_file_from_a_script': {status: 500},
    }).then(done, done.fail);
  });
 
  it('should return an error if a mock could not be found', function(done) {
    this.checkPaths('GET', {
      'api/missing_file': {status: 404},
    }).then(done, done.fail);
  });
});