david-mark / My-Library

The original cross-browser JS library/framework
http://www.cinsoft.net/mylib.html
59 stars 14 forks source link

Add unit tests to repo #5

Closed Raynos closed 12 years ago

Raynos commented 12 years ago

And if they don't exist they should probably be written. As reputable as you are, everyone makes mistakes.

If wanted I can write the first couple of unit tests with a reputable unit testing library and set up a test page.

david-mark commented 12 years ago

There is a (very) basic unit test framework in mylib-test.asp. See the Build Test link in the TOC (unit tests with console at bottom of page).

I would prefer if you add unit tests to that file for now. It is missing support for async tests, but I have that code around here somewhere (just never updated the test page).

Thanks a lot for all of your help! :)

And yes, I do make mistakes. My Library was slapped together in three weeks, four years ago and most of the CLJ people that pledged to help proof, test, etc. disappeared soon after. So unit tests, manual tests, suggestions, etc. appreciated.

On Sun, Jan 22, 2012 at 3:10 PM, Raynos < reply@reply.github.com

wrote:

And if they don't exist they should probably be written. As reputable as you are, everyone makes mistakes.

If wanted I can write the first couple of unit tests with a reputable unit testing library and set up a test page.


Reply to this email directly or view it on GitHub: https://github.com/cinsoft/My-Library/issues/5

Raynos commented 12 years ago

mylib-test.asp is not in the git repository. It should probably be added.

That unit test page is also not automated fully to run and report on all tests (Example automated test)

david-mark commented 12 years ago

Oops. The move was a bit disorganized with the (out of date itself) Google Code repository serving as the starting point. I thought I filled in all of the blanks, but must have forgotten that file. Will add it tomorrow as I don't have the command line interface available at the moment (unless there is a way to add a file through the Web interface).

At the bottom of the test page is a "Run Unit Tests" button that runs and reports on the tests. Could add a parameter to automatically run the tests on ready.

On Sun, Jan 22, 2012 at 4:12 PM, Raynos < reply@reply.github.com

wrote:

mylib-test.asp is not in the git repository. It should probably be added.

That unit test page is also not automated fully to run and report on all tests (Example automated test)


Reply to this email directly or view it on GitHub: https://github.com/cinsoft/My-Library/issues/5#issuecomment-3606239

david-mark commented 12 years ago

Can I add the file through Web UI? Don't care to install anything at the moment.

Or I could email it to you...

Raynos commented 12 years ago

if you email it, i'll open a pull request. i don't think you can do it through the web ui.

david-mark commented 12 years ago

On Sun, Feb 5, 2012 at 11:34 PM, Raynos < reply@reply.github.com

wrote:

if you email it, i'll open a pull request. i don't think you can do it through the web ui.

You got it. You'll find it contains a function to add a (synchronous) unit test. So each section of manual tests adds some module-specific unit tests behind the scenes. The button at the bottom, below the console, runs all of them and logs the results.

I only ever added eight tests. Certainly a library this size needs more than that. I appreciate your help. I'll try to dig up the async-capable version (for testing XHR and such) when I have a chance. I remember writing it, but don't think I ever tried it out.

Thanks! Dave


Reply to this email directly or view it on GitHub: https://github.com/cinsoft/My-Library/issues/5#issuecomment-3823487