@@ -12,7 +12,7 @@ describe('TypescriptPlugin Configuration', () => {
1212 expect ( ( ) =>
1313 typescriptPluginConfigSchema . parse ( {
1414 tsConfigPath,
15- tsCodes : [ 1000 , 1002 ] ,
15+ onlyAudits : [ 'ts-code-1065' , 'ts-code-2354' ] ,
1616 } satisfies TypescriptPluginOptions ) ,
1717 ) . not . toThrow ( ) ;
1818 } ) ;
@@ -30,55 +30,46 @@ describe('TypescriptPlugin Configuration', () => {
3030 it ( 'throws for invalid tsConfigPath type' , ( ) => {
3131 expect ( ( ) =>
3232 typescriptPluginConfigSchema . parse ( {
33- tsConfigPath : 123 ,
33+ onlyAudits : 123 ,
3434 } ) ,
35- ) . toThrow ( 'Expected string ' ) ;
35+ ) . toThrow ( 'invalid_type ' ) ;
3636 } ) ;
3737 } ) ;
3838
39- describe ( 'tsCodes ' , ( ) => {
40- it ( 'accepts a valid `tsCodes ` array' , ( ) => {
39+ describe ( 'onlyAudits ' , ( ) => {
40+ it ( 'accepts a valid `onlyAudits ` array' , ( ) => {
4141 expect ( ( ) =>
4242 typescriptPluginConfigSchema . parse ( {
4343 tsConfigPath,
44- tsCodes : [ 1000 , 1002 ] ,
45- } ) ,
44+ onlyAudits : [ 'ts-code-1065' , 'argument-expected-1011' ] ,
45+ } satisfies TypescriptPluginOptions ) ,
4646 ) . not . toThrow ( ) ;
4747 } ) ;
4848
4949 it ( 'accepts empty array for tsCodes' , ( ) => {
5050 expect ( ( ) =>
5151 typescriptPluginConfigSchema . parse ( {
5252 tsConfigPath,
53- tsCodes : [ ] ,
54- } ) ,
53+ onlyAudits : [ ] ,
54+ } satisfies TypescriptPluginOptions ) ,
5555 ) . not . toThrow ( ) ;
5656 } ) ;
5757
5858 it ( 'allows tsCodes to be undefined' , ( ) => {
5959 expect ( ( ) =>
6060 typescriptPluginConfigSchema . parse ( {
6161 tsConfigPath,
62- } ) ,
62+ } satisfies TypescriptPluginOptions ) ,
6363 ) . not . toThrow ( ) ;
6464 } ) ;
6565
66- it ( 'throws for invalid tsCodes type' , ( ) => {
67- expect ( ( ) =>
68- typescriptPluginConfigSchema . parse ( {
69- tsConfigPath,
70- tsCodes : 'invalidCodes' ,
71- } ) ,
72- ) . toThrow ( 'Expected array' ) ;
73- } ) ;
74-
7566 it ( 'throws for array with non-string elements' , ( ) => {
7667 expect ( ( ) =>
7768 typescriptPluginConfigSchema . parse ( {
7869 tsConfigPath,
79- tsCodes : [ 123 , true ] ,
70+ onlyAudits : [ 123 , true ] ,
8071 } ) ,
81- ) . toThrow ( 'Expected number, received boolean ' ) ;
72+ ) . toThrow ( 'invalid_type ' ) ;
8273 } ) ;
8374 } ) ;
8475} ) ;
0 commit comments