Berlin Brown
Berlin Brown

Reputation: 11744

Is there a framework for unit-testing both JavaScript and HTML

Is it possible to check the validity of your JavaScript code, even modern techniques and JavaScript calls with some form of validity checker? I have seen some that check JavaScript but about with the combination of your HTML document, possibly with CSS, possibly 'src' include path, etc?

And what are the normal approaches for this type of testing?

Upvotes: 1

Views: 224

Answers (2)

greggreg
greggreg

Reputation: 12085

JS Unit - https://github.com/pivotal/jsunit : Simple JavaScript unit test framework. Use it to check your code.

Selenium - http://seleniumhq.org/ : Use it to test your sites interface.

Use http://browsershots.org/ (free) to test the look of your site in different rendering engines.

If you maintain some semblance of testing there should be no need to make sure your code "validates", as perfectly valid code carries no guarantee of doing what you want it to.

Upvotes: 2

JohnP
JohnP

Reputation: 50029

If you're doing interface testing it's best to go with a framework like Selenium : http://seleniumhq.org/

You can create test suites and run them automatically when you do changes to your front end to make sure everything is still working as you expect.

Upvotes: 0

Related Questions