I am looking for an alternative to Select2 that basically provides the same functionality, but includes proper tests.

The quest for the holy grail? The last unicorn?

推荐答案

Selectize.js is a select2 alternative I've been working on that has a suite of tests using a combination of testem, syn, mocha, and chai. Right now there are the following classes of tests:

  • Interaction
    功能测试,确保控件的行为就像用户正在使用它一样(使用syn).
  • Setup
    确保可以从现有的<select><input>个元素正确初始化控件.
  • API
    Tests core API methods for proper functionality.
  • Events
    Ensures built-in events get fired at the right times with the proper arguments.
  • XSS
    测试了一些潜在的漏洞.

话虽如此,测试并不像我希望的那样广泛,但它正在实现:)

Jquery相关问答推荐

这是否会导致内存泄漏?

jquery清除输入默认值

如何在循环内创建动态变量名称?

无法在被动事件侦听器中阻止默认值

如何设置缓存:jQuery.get 调用中的 false

jQuery绑定到粘贴事件,如何获取粘贴的内容

jQuery.parseJSON 与 JSON.parse

禁用 Android 网页中输入焦点的zoom

根据弹出框相对于窗口边缘的 X 位置更改 Bootstrap 弹出框的位置?

jQuery .load() 调用不会在加载的 HTML 文件中执行 JavaScript

专业的基于 jQuery 的 Combobox 控件?

使用 jQuery 获取选定的选项 id

循环判断复选框并计算每个选中或未选中的复选框

在 jQuery UI 自动完成上没有检测到结果

覆盖 twitter bootstrap Textbox Glow and Shadows

如何删除/更改 JQuery UI 自动完成助手文本?

我可以通过 JavaScript 禁用 CSS :hover 效果吗?

jQuery.active 函数

如何删除集中的 contenteditable pre 周围的边框?

清除表jquery