2016-07-01 18:33:42 +03:00
|
|
|
'use strict';
|
|
|
|
import { SchemaHelper } from './schema-helper.service';
|
2016-10-23 20:18:42 +03:00
|
|
|
import { SpecManager } from '../utils/spec-manager';
|
2016-07-01 18:33:42 +03:00
|
|
|
|
|
|
|
describe('Spec Helper', () => {
|
2016-07-26 14:07:25 +03:00
|
|
|
describe('injectors', () => {
|
|
|
|
it('should autodetect type if not-specified', () => {
|
|
|
|
spyOn(console, 'warn').and.stub();
|
|
|
|
let schema = {
|
|
|
|
type: undefined,
|
|
|
|
properties: {}
|
|
|
|
};
|
|
|
|
|
|
|
|
SchemaHelper.runInjectors(schema, schema, '#/');
|
|
|
|
schema.type.should.be.equal('object');
|
|
|
|
expect(console.warn).toHaveBeenCalled();
|
|
|
|
(<jasmine.Spy>console.warn).and.callThrough();
|
|
|
|
});
|
|
|
|
});
|
2016-07-01 18:33:42 +03:00
|
|
|
});
|