tradle / serverless-iot-local

MIT License
14 stars 7 forks source link

Add unit tests #5

Closed MikeTheReader closed 6 years ago

MikeTheReader commented 6 years ago

I created some of these during while working on other stuff and figured I'd clean them up and send them your way. Not sure if Jest is your tool of choice for testing, but it seemed easiest.

To run tests: yarn test or npm test To run coverage: yarn coverage or npm coverage

Since eval.encode is never exported and never used it doesn't get covered by the tests.

mvayngrib commented 6 years ago

@MikeTheReader awesome, happily merging this, though personally i'm not a fan of jest. It has always been incredibly slow in my experience, compared to something minimal like tape or even mocha/jasmine. For example, these tests take 8 seconds to run on my MacBook Pro. It's kind of hilarious, what is jest doing all that time!? Is it the "mock everything" thing that takes so long?