Testing agent and device code

Hey Guys,

Is their a way by which I can automate testing for agent and device code or at-least write some unit-tests?
Its very time consuming to do a regression test humanly after introducing new changes.

You could compile the Squirrel interpreter on your PC and run your Squirrel code against “fake” or “mock” versions of the Electric Imp object model – but currently that’s quite nasty to set up, and you need a lot of Squirrel expertise. We’re researching ways of making it easier to do – we don’t deploy our own code until it’s got good unit-test coverage, so it’s only reasonable to enable our users to take the same principled stand.

Depending on exactly what your agent does, perhaps bits of it could be tested in an automated way using something like Selenium?

Peter

As @Peter mentioned - we’re trying to find better ways for developers to properly test their code.

In the meantime, if you’re just looking for a a test framework, someone did a partial port of Jasmine to Squirrel.

Crikey, that’s rather good! I hadn’t seen that before.

Peter

We’ve just released an open-source testing framework for exactly this purpose: https://discourse.electricimp.com/discussion/4546/nutkin-a-new-testing-framework-for-squirrel