You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript/TypeScript code that reproduces the crash?
import{routes,startServer}from'@/startServer';importmailUtilsfrom'@/utils/mailUtils';import*asSentryfrom'@sentry/node';import{afterAll,beforeAll,describe,test}from'bun:test';importfetchWrapperfrom'./fetchWrapper';// start the server before running the testsconsole.log('\n\nStarting server...\n');beforeAll(async()=>{startServer();});consterrors: any[]=[];constprodReceiver=['bla@eye-able.com','bla2@eye-able.com','bla3@eye-able.com'];constadditionalParams: Record<string,any>={/* '/search/auditlicenses': { searchterm: 'eye-able.com' }, '/search/assistlicensesbydomain': { domain: 'eye-able.com' }, '/search/reportentries': { searchterm: 'eye-able.com' }, '/search/users': { searchterm: 'api tester' }, */'/search/assistlicenses': {searchterm: 'eye-able.com'},'/search/organisations': {searchterm: 'web inclusion'},'/assistconfig': {domain: 'eye-able.com'},'/translatelicense': {domain: 'eye-able.com',key: 'bla'},'/licenseconstraints': {userid: 3},'/users': {id: 3},'/assistlicenses': {domain: 'eye-able.com'},'/reportentries/config': {entryid: 1}};if(Object.keys(routes).length<20){awaitonError('No or not enough routes found. Routes: '+JSON.stringify(routes,null,4));thrownewError('No or not enough routes found. Routes: '+JSON.stringify(routes,null,4));}letcookie='';asyncfunctiononError(error: any){if(Bun.env.PROD){Sentry.captureException('CRITICAL API ERROR!: '+error);}console.log('\nSending error mail...\n');returnawaitmailUtils.sendCriticalErrorMail({receiver: Bun.env.PROD
? prodReceiver
: ['bla@eye-able.com','blabla@gmail.com'],data: {errorInfo: error}});}describe('API tests',()=>{/* afterAll(async () => { // After all tests are done, check if any test failed if (errors.length) { console.error('afterAll | At least one test failed!'); console.log('Errors:', JSON.stringify(errors, null, 4)); await onError(errors); } const { numFailedTests } = jest.getState().testResults; if (numFailedTests > 0) { console.error('Some tests failed!'); } else { console.log('All tests passed!'); } }); */// Check if any test failed after running all testsafterAll(async()=>{if(errors.length){console.error('At least one test failed!');console.log('Errors:',JSON.stringify(errors,null,4));awaitonError(errors);}else{console.log('All tests passed!');}});// Login and retrieve tokenbeforeAll(async()=>{try{if(!Bun.env.TEST_PASSWORD){thrownewError('TEST_PASSWORD not set in .env file');}constres=awaitfetchWrapper('/authentication/login',{method: 'POST',body: JSON.stringify({email: blabla@eye-able.com',password: Bun.env.TEST_PASSWORD}),headers: {'Content-Type': 'application/json'}});cookie=res.headers.get('SET-COOKIE')||'';if(!cookie){thrownewError('Cookie not found in login response');}}catch(error){console.error('Login failed:',error);awaitonError('API Login failed!');thrownewError('Login failed, stopping all tests.');// This will stop further tests from running in this describe block}});// Test all GET routesdescribe('checking GET methods of all routes',()=>{for(let[path,handlers]ofObject.entries(routes)){for(consthandlerofhandlers){if(handler.method&&handler.method==='GET'){test(`GET ${path}`,async()=>{try{if(additionalParams[path]){constparams=newURLSearchParams();for(const[key,value]ofObject.entries(additionalParams[path])){params.set(key,String(value));}path+='?'+params.toString();}awaitfetchWrapper(path,{},cookie);}catch(error){console.error(`GET ${path} failed:`,error);errors.push(error);throwerror;}});}}}});});
Relevant log output
No response
Stack Trace (bun.report)
Bun v1.1.6 (e58d67b) on linux x86_64 [TestCommand]
How can we reproduce the crash?
No response
JavaScript/TypeScript code that reproduces the crash?
Relevant log output
No response
Stack Trace (bun.report)
Bun v1.1.6 (
e58d67b
) on linux x86_64 [TestCommand]Segmentation fault at address 0x00000000
ld-temp.o:0
:WTF::jscSignalHandler
The text was updated successfully, but these errors were encountered: