import { beforeEach, describe, expect, it } from 'vitest'; import { getStylelintResult } from './utils'; describe( 'flags no warnings with valid commenting css', () => { let result; beforeEach( () => { result = getStylelintResult( './commenting-valid.css' ); } ); it( 'did not error', () => { return result.then( ( data ) => expect( data.errored ).toBeFalsy() ); } ); it( 'flags no warnings', () => { return result.then( ( data ) => expect( data.results[ 0 ].warnings ).toHaveLength( 0 ) ); } ); } ); describe( 'flags warnings with invalid commenting css', () => { let result; beforeEach( () => { result = getStylelintResult( './commenting-invalid.css' ); } ); it( 'did error', () => { return result.then( ( data ) => expect( data.errored ).toBeTruthy() ); } ); it( 'flags correct number of warnings', () => { return result.then( ( data ) => expect( data.results[ 0 ].warnings ).toHaveLength( 3 ) ); } ); it( 'snapshot matches warnings', () => { return result.then( ( data ) => expect( data.results[ 0 ].warnings ).toMatchSnapshot() ); } ); } );