File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 1
- import { readdir } from 'node:fs/promises'
1
+ import fs from 'node:fs/promises'
2
+ import path from 'node:path'
2
3
import { expect , test } from 'vitest'
3
4
import plugin from '../../src/index'
4
5
5
- test ( 'has all rules' , async ( ) => {
6
- const files = await readdir ( 'src/rules' )
6
+ test ( 'exports all rules' , async ( ) => {
7
+ const files = await fs . readdir ( 'src/rules' )
7
8
const { rules } = plugin . configs [ 'flat/recommended' ] . plugins . playwright
8
9
const ruleKeys = Object . keys ( rules ) . sort ( )
9
10
const fileKeys = files
@@ -13,3 +14,16 @@ test('has all rules', async () => {
13
14
14
15
expect ( ruleKeys ) . toEqual ( fileKeys )
15
16
} )
17
+
18
+ test ( 'has all rules in the README' , async ( ) => {
19
+ const readme = await fs . readFile (
20
+ path . resolve ( __dirname , '../../README.md' ) ,
21
+ 'utf-8' ,
22
+ )
23
+
24
+ const { rules } = plugin . configs [ 'flat/recommended' ] . plugins . playwright
25
+
26
+ for ( const rule of Object . keys ( rules ) ) {
27
+ expect ( readme ) . toContain ( `[${ rule } ]` )
28
+ }
29
+ } )
You can’t perform that action at this time.
0 commit comments