tôi là tạo ra một widget js và một phần đầu tiên là thêm kịch bản rộng javascript, một cái gì đó như thế này (ví dụ từ Google Analytics):Kiểm tra DOM thao tác trong thử nghiệm Jasmine
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
Làm thế nào để thử nghiệm nó với hoa nhài (sử dụng đồ đạc?)?
có thể trùng lặp [cách kiểm tra đơn vị DOM thao tác (với hoa nhài)] (http://stackoverflow.com/questions/16163852/how-to-unit -test-dom-manipulation-with-jasmine) – Gajus