thentos
thentos copied to clipboard
Set up test suite for purescript code
Write one or two tests for the existing purescript functions. Define a simple way to call the test suite (doesn't have to be integrated with the backend tests via selenium yet for now).
Current status
I initially wanted to use the test infrastructure that comes with the purescript tools (so we could just pulp test
to run the tests). The problem with that is that this uses node.js to execute the tests, which doesn't work because we're using xmlhttprequest
in our tests, which apparently doesn't exist in node. So we need to run the tests in the browser.
I've started using purescript-spec which supports running tests either in the browser or with node. To use it in the browser, I wanted to use [https://github.com/owickstrom/purescript-spec-reporter-mocha], which seems to work well enough, except that it hangs indefinitely when the test does anything asynchronously. I'm not sure whether this is a bug or just me being incompetent with js stuff, but I've filed an issue on the project.
Potentially relevant: https://github.com/slamdata/purescript-webdriver
Ah, my mistake: purescript-webdriver only helps if one wants to run selenium from node. Doesn't help with getting test suites in the browser to work.