run tests for qt.localstorage

asked 2019-12-19 08:34:53 +0300

pawel gravatar image

updated 2020-01-26 15:36:26 +0300

Dear all it took me weeks to come to a solution, so would like to share it:

problem: have native app in qml and js using qt.localstorage for storage. the app is a shopping list so has some 3-4 tables and a bit of logic. the db model did evolve over time, so db upgrades are an issue. manual testing on emulator / phone are time consuming

i have windows background, c# a bit of typescript, so how can i run tests for the db logic on windows laptop ? how can i get rid of those boring js runtime bugs ?

solution: - sqlite3 for windows - typescript - visual studio code - sqlite-sync npm package for sqlite access from node.js - mocha for tests - db access wrapper

the whole approach will also work on any os able to run node.js and sqlite

code can be found: https://github.com/PawelSpoon/harbour-olive-goes-shopping

did move to linux: (so here is the update)

you will need to install ts-node npm install -g ts-node

rest should be fine due to package.config i am using now Git-Cola as there is no github-desktop at them moment for linux. the snap pacakage did not work for me.

edit retag flag offensive close delete