mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-11-04 01:37:32 +03:00 
			
		
		
		
	Add Redoc init spec
This commit is contained in:
		
							parent
							
								
									6f01d61bd4
								
							
						
					
					
						commit
						7e11eb56e7
					
				
							
								
								
									
										26
									
								
								lib/index.spec.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								lib/index.spec.js
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,26 @@
 | 
			
		|||
'use strict';
 | 
			
		||||
import {init} from 'lib/index';
 | 
			
		||||
 | 
			
		||||
describe('Redoc init', () => {
 | 
			
		||||
  it('should return promise', () => {
 | 
			
		||||
    let res = init();
 | 
			
		||||
    res.should.be.instanceof(Promise);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should reject promise for not specifed url', (done) => {
 | 
			
		||||
    let res = init();
 | 
			
		||||
    res.then(() => { done.fail('Should not been called'); }, () => {
 | 
			
		||||
      done();
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  //skip because of PhantomJS crashes on this testcase
 | 
			
		||||
  xit('should init redoc', (done) => {
 | 
			
		||||
    var node = document.createElement('redoc');
 | 
			
		||||
    document.body.appendChild(node);
 | 
			
		||||
    let res = init('/tests/schemas/extended-petstore.json');
 | 
			
		||||
    res.then(() => { done(); }, () => {
 | 
			
		||||
      done.fail('Error handler should not been called');
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user