Share via


datajs goodies - test logger

Today I'd like to talk about one of the extra goodies you can find in the datajs project.

The TestLogger.svc file under JSLib\tests\common contains a small WCF service that accepts messages from the test page and records test results, and the test driver is then able to ask for them and figure out whether all tests passed or whether something went wrong.

Because we care a lot about developers (including ourselves!) we wanted to make sure that the results were easy to consume. What we did then was provide the ability to generate a simple .trx file, which is the the test result file that Visual Studio uses. After a test run, the file can then be opened in the tool, and you can sort on results, look at the log messages, etc., without needing to install or learn a new tool.

The service doesn't support every bit of information that can be represented in .trx, but it's good enough for the test pages. We simply looked at the XSD for the results, read Dominic's awesome post on helpful internals, and did a bit of experimentation to see what works. If you're interested in something similar, that's a bit of work you don't have to do.

Enjoy!