You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello guys!
So I am trying to implement unit tests for the application. I understand that currently we only have sample tests. Can anyone advice on a test runner to use for this and any documentation to guide if possible.
@akabiru aweh! So I am having a tiny problem: I added a new sample test file sampletest.elm
myTest = test "Example Test"(assert True)
But when I run yarn test the only tests that run and pass are the ones that passed before I added mine, So mine neither passes nor fails vis a vis doesn't run. I suspect I am adding the test wrongly could you run me through adding a test? Much Regards!
Ok I think I have a handle on this I have now got a test failing.
Great Success.
My new Test goes as follows, Sample
moduleSampleexposing (..)
importTestexposing(..)
importExpectall:Testall =
describe "New Test Case"[ sampleTest]sampleTest:TestsampleTest =
describe "Sample 1"[ test "New Test"<|\()->Expect.equal(3+3)7]
My current issue is that I can't run this in conjunction with the other existing tests i.e Tests
I have changed TestRunner as such
port moduleTestRunnerexposing (..)
importTestsimportTest.Runner.Nodeexposing (run, TestProgram)
importJson.Encodeexposing (Value)
importSamplemain:TestProgrammain =
run emit Sample.all
port emit: ( String, Value ) ->Cmdmsg
Could anyone help me with running a list as [Sample.all, Tests.all] doesn't yield
Following this the tests run and my failing test does fail.
Will add a PR to start working on the tests as we document the components and learn what they are supposed to do I can add tests for them.
Activity
zacck-zz commentedon Apr 5, 2017
Hello guys!
So I am trying to implement unit tests for the application. I understand that currently we only have sample tests. Can anyone advice on a test runner to use for this and any documentation to guide if possible.
akabiru commentedon Apr 5, 2017
@zacck the test runner is already defined. We integrated elm-test for that.
zacck-zz commentedon Apr 5, 2017
@akabiru aweh! So I am having a tiny problem: I added a new sample test file
sampletest.elm
But when I run
yarn test
the only tests that run and pass are the ones that passed before I added mine, So mine neither passes nor fails vis a vis doesn't run. I suspect I am adding the test wrongly could you run me through adding a test? Much Regards!zacck-zz commentedon Apr 5, 2017
Ok I think I have a handle on this I have now got a test failing.
Great Success.
My new Test goes as follows,
Sample
My current issue is that I can't run this in conjunction with the other existing tests i.e
Tests
I have changed
TestRunner
as suchCould anyone help me with running a list as
[Sample.all, Tests.all]
doesn't yieldakabiru commentedon Apr 5, 2017
@zacck You're on the right track. Once you have your test in
SampleTest.elm
You can then import the module in
Tests.elm
and add them to the describe list.zacck-zz commentedon Apr 6, 2017
@waiyaki aweh! Ok I think we have handle on this I had to modify your example just a tiny bit so my
Tests
file ended up looking as suchFollowing this the tests run and my failing test does fail.
Will add a PR to start working on the tests as we document the components and learn what they are supposed to do I can add tests for them.
akabiru commentedon Apr 6, 2017
Awesome!! Looking forward to that! 🕺🏽