@@ -75,9 +75,9 @@ describe('lint-md GitHub action 测试', () => {
7575 expect ( lintMdAction . isPass ( ) ) . toStrictEqual ( true )
7676 } )
7777
78- test ( '用户在 GitHub Action 将 failOnWarnings 值设为 true,本次 ci fail' , async ( ) => {
78+ test ( '用户在 GitHub Action 将 failOnWarnings 值设为 true,即使只有 warning 本次 ci fail' , async ( ) => {
7979 process . env . GITHUB_WORKSPACE = path . resolve ( process . cwd ( ) , 'examples' , 'only-warning' )
80- mockAction ( null , '.lintmdrc' , true )
80+ mockAction ( null , '.lintmdrc' , ' true' )
8181 const lintMdAction = new LintMdAction ( )
8282 // lint
8383 await lintMdAction . lint ( )
@@ -86,10 +86,22 @@ describe('lint-md GitHub action 测试', () => {
8686
8787 test ( '用户自定义的配置文件为 JavaScript 模块' , async ( ) => {
8888 process . env . GITHUB_WORKSPACE = path . resolve ( process . cwd ( ) , 'examples' , 'js-config' )
89- mockAction ( null , '.lintmdrc.js' , true )
89+ mockAction ( null , '.lintmdrc.js' , ' true' )
9090 const lintMdAction = new LintMdAction ( )
9191 // lint
9292 await lintMdAction . lint ( )
9393 expect ( lintMdAction . isPass ( ) ) . toStrictEqual ( false )
9494 } )
95+
96+ test ( '用户传入了多个以空格分割的检测目录' , async ( ) => {
97+ process . env . GITHUB_WORKSPACE = path . resolve ( process . cwd ( ) , 'examples' )
98+ mockAction ( './js-config ./no-config-file' , null , 'true' )
99+ const lintMdAction = new LintMdAction ( )
100+ // lint
101+ await lintMdAction . lint ( )
102+ lintMdAction . showResult ( )
103+ lintMdAction . showErrorOrPassInfo ( )
104+ const totalErrors = lintMdAction . getErrors ( )
105+ expect ( totalErrors . length ) . toStrictEqual ( 2 )
106+ } )
95107} )
0 commit comments