thentos icon indicating copy to clipboard operation
thentos copied to clipboard

Set up test suite for purescript code

Open fisx opened this issue 9 years ago • 3 comments

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

fisx avatar Oct 05 '15 10:10 fisx

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.

fhartwig avatar Oct 08 '15 09:10 fhartwig

Potentially relevant: https://github.com/slamdata/purescript-webdriver

fisx avatar Oct 28 '15 11:10 fisx

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.

fisx avatar Oct 28 '15 11:10 fisx