mimosa icon indicating copy to clipboard operation
mimosa copied to clipboard

Unit Tests

Open Anachron opened this issue 10 years ago • 6 comments

I'm just wondering, will you add unit tests to Mimosa? This will allow you to test for breaking old changes before you actually push it to git (using git hooks for example).

Anachron avatar Mar 05 '14 21:03 Anachron

Yup. I've always wanted to do that. It's been a factor of time. It's a hard thing to recover from once you've gone down a path. Its one of the reasons I've been so keen to pull everything out of core. Pulling everything apart makes things easier to test.

I need to come up with a good means to do in an automated fashion what I do by hand via various test projects.

dbashford avatar Mar 05 '14 21:03 dbashford

Pokes @dbashford

Anachron avatar May 03 '14 16:05 Anachron

Not anytime soon. Current backlog. JavaScript conversion. Blogging. Site updates. All more important in the short term.

dbashford avatar May 05 '14 13:05 dbashford

Gonna bump this one, it's becoming clear that unit tests are useful, for example https://github.com/dbashford/mimosa-bower/issues/39.

Anachron avatar Jul 14 '14 11:07 Anachron

In most cases unit tests would take the form of test harness projects that exercise much of the functionality of the module/codebase and test/check the file system or stdout to make sure the right thing happened. Some, like compilers, can just isolate the module and test input and output text.

I have test harness projects, and its easy to whip up one. I just don't have them such that they exercise all possible options. As always, I welcome pull requests.

dbashford avatar Jul 14 '14 11:07 dbashford

I made test harness projects for the mimosa module’s I have made so far - but these projects currently live outside the code for the module itself. Also in the case of my modules I didn’t actually wire up any checking to any test runner — so its a manual process to run through the ‘mimosa build’ and then manually verify expected operation of the project … A 'standard way' to hook up a test runner to mimosa modules/testing projects might be a nice thing ...

Is there a good way to automate the running of the 'test harness’ projects and/or a standard way to set things up so that the ’test projects' can co-exist in the mimosa module’s codebase?

(sorry if looking at some of the mimosa module code will answer this question directly — I haven’t noticed any of the test harness projects in the past — are they on github also? …)

Ben

On Jul 14, 2014, at 5:26 PM, dbashford [email protected] wrote:

In most cases unit tests would take the form of test harness projects that exercise much of the functionality of the module/codebase and test/check the file system or stdout to make sure the right thing happened. Some, like compilers, can just isolate the module and test input and output text.

I have test harness projects, and its easy to whip up one. I just don't have them such that they exercise all possible options. As always, I welcome pull requests.

— Reply to this email directly or view it on GitHub.

breathe avatar Jul 15 '14 07:07 breathe