Skip to content

Conversation

@fizruk
Copy link

@fizruk fizruk commented Aug 26, 2016

I can split this into 2 separate PRs if needed.

So far I have a problem with running tests. I have updated them to use purescript-spec, but still couldn't run them in browser. Right now when I open test/test.html I get this error:

TypeError: undefined is not an object (evaluating '$foreign.process.stdout.isTTY')

I'd appreciate any hints, since I'm new to PureScript.

@actionshrimp
Copy link

actionshrimp commented Aug 31, 2016

Also new to purescript, but hopefully this will be of some vague use. Looks like something in the browser is expecting certain nodejs properties to be available - isTTY is a property on the nodejs global process.stdout object. Not sure what exactly is expecting it to be there though!

purescript-spec has a dependency on purescript-node-process which adds types for it, so could be that? Looks like you might need to run the tests with mocha/karma for purescript-spec to behave as expected, rather than just opening the tests in a browser window.

@actionshrimp
Copy link

Thanks for taking the time to take a look at this btw :)

@actionshrimp
Copy link

actionshrimp commented Aug 31, 2016

Had a little go at this myself. No luck getting the spec tests to run unfortunately, but I switched back to the quickcheck ones and got those running ok (although maybe you did too? :) ) - only one failure which I haven't investigated yet.

The changes I made are here: actionshrimp@caad64f

And I ran:

pulp browserify --main Test.Main -I test --standalone runTests > test/test-main.js

to generate the test bundle. Then had to call runTests.main()(); in the html file (- not sure why leaving --standalone .. off didn't work, it seemed to call the outer main function but not the __do function inside?)

@mrmurphy
Copy link

Would love to see this get more attention and help. Wish I could offer it myself!

@owickstrom
Copy link

owickstrom commented Jan 11, 2017

Hi! Maybe I could help (original author of purescript-spec). Not sure really what's going on here, but at a quick glance I see you're using the standard runner, which is for NodeJS, but it seems you are manipulating the DOM and need to run tests in a browser. Correct? In that case you should try https://github.com/owickstrom/purescript-spec-mocha instead, which bypasses the Node stuff and runs tests using the Mocha API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants