@@ -60,9 +60,9 @@ describe('getConfig', () => {
6060
6161 expect ( mockLoggerFatal ) . toContain ( 'Errors parsing your `.seccorc` file' )
6262 expect ( mockLoggerFatal ) . toContain ( `- source.path
63- - \`source.path\` is required and must be a string
63+ - The key \`source.path\` is required and no other keys are allowed.
6464- source.cwd
65- - Only the key \`source.path\` is allowed` )
65+ - The key \`source.path\` is required and no other keys are allowed. ` )
6666 } )
6767 it ( 'should error when source.path is not an absolute path' , ( ) => {
6868 ( read as unknown as Mock ) . mockReturnValue ( {
@@ -77,7 +77,7 @@ describe('getConfig', () => {
7777
7878 expect ( mockLoggerFatal ) . toContain ( 'Errors parsing your `.seccorc` file' )
7979 expect ( mockLoggerFatal ) . toContain ( `- source.path
80- - \`source.path\` must be an absolute path` )
80+ - \`source.path\` must be an absolute path. ` )
8181 } )
8282 it ( 'should return source.path from valid .seccorc file' , ( ) => {
8383 const srcPath = '/path/to/source' ;
@@ -117,7 +117,7 @@ describe('sourcePathSchema', () => {
117117 const schema = sourcePathSchema ( 'test' )
118118 const input = '/'
119119 const output = parse ( schema , input )
120- const error = '\`test\` is required and must be a string'
120+ const error = '\`test\` must be a string. '
121121
122122 expect ( output ) . toBe ( input )
123123 expect ( ( ) => parse ( schema , 123 ) ) . toThrowError ( error )
@@ -136,7 +136,7 @@ describe('sourcePathSchema', () => {
136136 const output = parse ( schema , input )
137137
138138 expect ( output ) . toBe ( input )
139- expect ( ( ) => parse ( schema , 'path/to/source' ) ) . toThrowError ( '\`test\` must be an absolute path' )
139+ expect ( ( ) => parse ( schema , 'path/to/source' ) ) . toThrowError ( '\`test\` must be an absolute path. ' )
140140 } )
141141} )
142142
@@ -152,8 +152,8 @@ describe('configSchema', () => {
152152 expect ( ( ) => parse ( ConfigSchema , '/path/to/source' ) ) . toThrowError ( 'You must pass an object' )
153153 } )
154154 it ( 'should only pass objects with valid entries' , ( ) => {
155- expect ( ( ) => parse ( ConfigSchema , { } ) ) . toThrowError ( 'Only the key `source.path` is allowed ' )
156- expect ( ( ) => parse ( ConfigSchema , { invalid : 'key' } ) ) . toThrowError ( 'Only the key `source.path` is allowed ' )
157- expect ( ( ) => parse ( ConfigSchema , { source : { invalid : 'key' } } ) ) . toThrowError ( '\`source.path\` is required and must be a string ' )
155+ expect ( ( ) => parse ( ConfigSchema , undefined ) ) . toThrowError ( 'You must pass an object with a \ `source\` key. ' )
156+ expect ( ( ) => parse ( ConfigSchema , { invalid : 'key' } ) ) . toThrowError ( 'You must pass an object with a \ `source\` key. ' )
157+ expect ( ( ) => parse ( ConfigSchema , { source : { invalid : 'key' } } ) ) . toThrowError ( 'The key \`source.path\` is required and no other keys are allowed. ' )
158158 } )
159159} )
0 commit comments