activate other tests again

This commit is contained in:
Simon Laux
2022-06-20 16:19:33 +02:00
parent d93622bc84
commit d8d26b9cae
2 changed files with 3 additions and 26 deletions

View File

@@ -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)

View File

@@ -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
})
}