mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	#1391: flag validation errors and warnings as test failures
This commit is contained in:
		
							parent
							
								
									40b7d2c6e4
								
							
						
					
					
						commit
						6c107344aa
					
				@ -54,7 +54,7 @@ test('the generated OpenAPI spec is valid', async () => {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const [openapi, error, warning] = await enforcer(body, {
 | 
			
		||||
    const [, error, warning] = await enforcer(body, {
 | 
			
		||||
        fullResult: true,
 | 
			
		||||
        componentOptions: {
 | 
			
		||||
            exceptionSkipCodes: [
 | 
			
		||||
@ -63,12 +63,12 @@ test('the generated OpenAPI spec is valid', async () => {
 | 
			
		||||
        },
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    if (warning !== undefined) {
 | 
			
		||||
        console.warn(warning);
 | 
			
		||||
    }
 | 
			
		||||
    if (error !== undefined) {
 | 
			
		||||
        console.error(error);
 | 
			
		||||
    }
 | 
			
		||||
    if (warning !== undefined) {
 | 
			
		||||
        // some of these _should_ probably be dealt with at some point.
 | 
			
		||||
        console.warn(warning);
 | 
			
		||||
    }
 | 
			
		||||
    if (openapi !== undefined) console.log('Document is valid');
 | 
			
		||||
 | 
			
		||||
    expect(warning ?? error).toBe(undefined);
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user