Riot. js quick JavaScript unit testing framework

Source: Internet
Author: User

Http://github.com/alexyoung/riotjs
Example:
Ruby Code Copy code The Code is as follows: Context "a new user" do
Setup {user. New}
Asserts ("that it is not yet created") {topic. new_record? }
End

Context "a new user" do
Setup {user. New}
Asserts ("that it is not yet created") {topic. new_record? }
End

JavaScript codeCopy codeThe Code is as follows: riot. Run (function (){
Context ('basic riot functionality ', function (){
Given ('some simple equality tests', function (){
Asserts ('a simple truth test shocould return true', true). istrue ();
Asserts ('isnull is null', null). isnull ();
});

Given ('another context', function (){
Asserts ('equals shoshould compare strings as expected', 'test string'). Equals ('test string ');
});

Given ('a context concerned with Functions ', function (){
Asserts ('asserts () shocould allow functions to be computed', function (){
Return 'test string ';
}). Equals ('test string ');
});
});

Given ('yunanother context', function (){
Asserts ('equals shoshould compare strings as expected', 'test string'). Equals ('test string ');
});
});

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.