diff --git a/node/segfault.js b/node/segfault.js deleted file mode 100644 index 8eb376faa..000000000 --- a/node/segfault.js +++ /dev/null @@ -1,22 +0,0 @@ -const { default: dc } = require('./dist') - -const ac = new dc('test123456') - -ac.startJSONRPCHandler(console.log) - -console.log( - ac.jsonRPCRequest( - JSON.stringify({ - jsonrpc: '2.0', - method: 'get_all_account_ids', - params: [], - id: 2, - }) - ) -) - -setTimeout(() => { - ac.close() // This segfaults -> TODO Findout why? - - console.log('still living') -}, 1000) diff --git a/node/test/test.js b/node/test/test.js index 5aad22382..281d6301a 100644 --- a/node/test/test.js +++ b/node/test/test.js @@ -84,7 +84,7 @@ describe('static tests', function () { }) }) -describe.only('JSON RPC', function () { +describe('JSON RPC', function () { it('smoketest', async function () { const { dc } = DeltaChat.newTemporary() let promise_resolve @@ -108,14 +108,13 @@ describe.only('JSON RPC', function () { }, JSON.parse(await promise) ) - // TODO: fix that shutdown crashes! dc.close() }) it('basic test', async function () { const { dc } = DeltaChat.newTemporary() - const promises = {}; + const promises = {} dc.startJSONRPCHandler((msg) => { const response = JSON.parse(msg) promises[response.id](response) @@ -123,7 +122,7 @@ describe.only('JSON RPC', function () { }) const call = (request) => { dc.jsonRPCRequest(JSON.stringify(request)) - return new Promise((res, _rej)=> { + return new Promise((res, _rej) => { promises[request.id] = res }) }