国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

Riot.js 快速的JavaScript單元測試框架

2024-05-06 14:13:01
字體:
來源:轉載
供稿:網友
http://github.com/alexyoung/riotjs
示例:
Ruby代碼
代碼如下:
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代碼
代碼如下:
Riot.run(function() {
context('basic riot functionality', function() {
given('some simple equality tests', function() {
asserts('a simple truth test should return true', true).isTrue();
asserts('isNull is null', null).isNull();
});

given('another context', function() {
asserts('equals should compare strings as expected', 'test string').equals('test string');
});

given('a context concerned with functions', function() {
asserts('asserts() should allow functions to be compared', function() {
return 'test string';
}).equals('test string');
});
});

given('yet another context', function() {
asserts('equals should compare strings as expected', 'test string').equals('test string');
});
});
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 明水县| 永丰县| 迁西县| 内黄县| 休宁县| 潼南县| 宜良县| 扶风县| 阿巴嘎旗| 买车| 高青县| 昌邑市| 华安县| 千阳县| 青冈县| 山东| 太白县| 资溪县| 隆林| 南岸区| 广平县| 梁山县| 会宁县| 章丘市| 三台县| 乳源| 永泰县| 宁陵县| 周口市| 万源市| 万载县| 徐水县| 安仁县| 甘南县| 拉萨市| 建昌县| 双辽市| 饶河县| 永清县| 山东| 新龙县|