test(semantic-release-error): switched instanceof check to the native version
since the check provided by the ava assertion seems to fail beyond the context of the test
This commit is contained in:
		
							parent
							
								
									d259350c3e
								
							
						
					
					
						commit
						4bf763f264
					
				| @ -1853,10 +1853,19 @@ test.serial("Throw an Error if plugin returns an unexpected value", async (t) => | |||||||
|   await td.replaceEsm("../lib/get-logger.js", null, () => t.context.logger); |   await td.replaceEsm("../lib/get-logger.js", null, () => t.context.logger); | ||||||
|   await td.replaceEsm("env-ci", null, () => ({ isCi: true, branch: "master", isPr: false })); |   await td.replaceEsm("env-ci", null, () => ({ isCi: true, branch: "master", isPr: false })); | ||||||
|   const semanticRelease = (await import("../index.js")).default; |   const semanticRelease = (await import("../index.js")).default; | ||||||
|   const error = await t.throwsAsync( | 
 | ||||||
|     semanticRelease(options, { cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer() }), |   let error; | ||||||
|     { instanceOf: SemanticReleaseError } |   try { | ||||||
|   ); |     await semanticRelease(options, { | ||||||
|  |       cwd, | ||||||
|  |       env: {}, | ||||||
|  |       stdout: new WritableStreamBuffer(), | ||||||
|  |       stderr: new WritableStreamBuffer(), | ||||||
|  |     }); | ||||||
|  |   } catch (e) { | ||||||
|  |     error = e; | ||||||
|  |   } | ||||||
|  |   t.is(error.code, "EANALYZECOMMITSOUTPUT"); | ||||||
|   t.regex(error.details, /string/); |   t.regex(error.details, /string/); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user