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

首頁 > 編程 > JavaScript > 正文

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

2019-11-21 01:00:04
字體:
來源:轉載
供稿:網友
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');
});
});
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 固原市| 长岭县| 申扎县| 于田县| 新平| 富顺县| 莆田市| 芜湖市| 莎车县| 广安市| 辽中县| 道孚县| 辽阳县| 枣庄市| 富民县| 中西区| 鄂伦春自治旗| 公安县| 巫山县| 罗甸县| 始兴县| 武定县| 手游| 灯塔市| 昭通市| 封丘县| 桦甸市| 敦煌市| 东阿县| 麦盖提县| 姚安县| 舒兰市| 资源县| 新闻| 无锡市| 逊克县| 尼勒克县| 横山县| 额敏县| 儋州市| 濮阳市|