diff --git a/qtip2/qtip2-tests.ts b/qtip2/qtip2-tests.ts
new file mode 100644
index 000000000..ea4e16099
--- /dev/null
+++ b/qtip2/qtip2-tests.ts
@@ -0,0 +1,1051 @@
+///
+
+var $a = $('_');
+
+
+/**
+ * Test core properties (http://qtip2.com/options#core)
+ */
+function testCoreProperties() {
+ // Test with all core options specififed
+ $a.qtip({
+ content: 'Jan Jansen',
+ id: 'jan-jansen',
+ prerender: true,
+ overwrite: true,
+ suppress: true,
+ metadata: {
+ type: 'html5',
+ name: 'qtipopts'
+ }
+ });
+
+ // Test ID as boolean
+ $a.qtip({
+ content: 'yoshimo',
+ id: false
+ });
+
+ // Test with no options specified
+ $a.qtip({
+ content: 'aerie'
+ });
+}
+
+
+/**
+ * http://qtip2.com/options#content.text
+ */
+function testContentText() {
+ // Shorthand string
+ $a.qtip({
+ content: 'valygar'
+ });
+
+ // Regular string
+ $a.qtip({
+ content: { text: 'kivan' }
+ });
+
+ // Shorthand boolean
+ $a.qtip({
+ content: true
+ });
+
+ // Regular boolean
+ $a.qtip({
+ content: { text: true }
+ });
+
+ // Shorthand Deferred / Promise
+ $a.qtip({
+ content: $.Deferred().resolve('cernd')
+ });
+
+ $a.qtip({
+ content: $.Deferred().reject().promise()
+ });
+
+ // Regular Deferred / Promise
+ $a.qtip({
+ content: { text: $.Deferred().resolve('horatio') }
+ });
+
+ $a.qtip({
+ content: { text: $.Deferred().reject().promise() }
+ });
+
+ // Shorthand function
+ $a.qtip({
+ content: function(event: Event, api: QTip2.Api) { }
+ });
+
+ $a.qtip({
+ content: function(event: Event) { return 2; }
+ });
+
+ $a.qtip({
+ content: function() { }
+ });
+
+ // Regular function
+ $a.qtip({
+ content: { text: function(event: Event, api: QTip2.Api) {} }
+ });
+
+ $a.qtip({
+ content: { text: function(event: Event) { return 2; } }
+ });
+
+ $a.qtip({
+ content: { text: function() { } }
+ });
+
+ // Shorthand jQuery elements
+ $a.qtip({
+ content: $('.irenicus')
+ });
+
+ // Regular jQuery elements
+ $a.qtip({
+ content: { text: $('.irenicus') }
+ });
+}
+
+
+/**
+ * http://qtip2.com/options#content.title
+ */
+function testContentTitle() {
+ // Shorthand string
+ $a.qtip({
+ content: { title: 'keldorn' }
+ });
+
+ // Regular string
+ $a.qtip({
+ content: {
+ title: { text: 'nalia' }
+ }
+ });
+
+ // Shorthand boolean
+ $a.qtip({
+ content: { title: true }
+ });
+
+ // Regular boolean
+ $a.qtip({
+ content: {
+ title: { text: true }
+ }
+ });
+
+ // Shorthand Deferred / Promise
+ $a.qtip({
+ content: { title: $.Deferred().resolve('mazzy') }
+ });
+
+ $a.qtip({
+ content: { title: $.Deferred().reject().promise() }
+ });
+
+ // Regular Deferred / Promise
+ $a.qtip({
+ content: { title: { text: $.Deferred().resolve('bodhi') } }
+ });
+
+ $a.qtip({
+ content: { title: { text: $.Deferred().reject().promise() } }
+ });
+
+ // Shorthand function
+ $a.qtip({
+ content: { title: function(event: Event, api: QTip2.Api) {} }
+ });
+
+ $a.qtip({
+ content: { title: function(event: Event) { return 2; } }
+ });
+
+ $a.qtip({
+ content: { title: function() { } }
+ });
+
+ // Regular function
+ $a.qtip({
+ content: { title: { text: function(event: Event, api: QTip2.Api) { } } }
+ });
+
+ $a.qtip({
+ content: { title: { text: function(event: Event) { return 2; } } }
+ });
+
+ $a.qtip({
+ content: { title: { text: function() { } } }
+ });
+
+ // Shorthand jQuery elements
+ $a.qtip({
+ content: { title: $('.irenicus') }
+ });
+
+ // Regular jQuery elements
+ $a.qtip({
+ content: { title: { text: $('.irenicus') } }
+ });
+}
+
+
+/**
+ * http://qtip2.com/options#content.button
+ */
+function testContentButtonProperty() {
+ $a.qtip({
+ content: { button: $('.minsc') }
+ });
+
+ $a.qtip({
+ content: { button: 'jaheira' }
+ });
+
+ $a.qtip({
+ content: { button: true }
+ });
+}
+
+
+/**
+ * http://qtip2.com/options#content.attr
+ */
+function testContentAttrProperty() {
+ $a.qtip({
+ content: { attr: 'viconia' }
+ });
+}
+
+
+/**
+ * http://qtip2.com/options#position
+ */
+function testPositionProperty() {
+ // Shorthand
+ $a.qtip({ position: 'top left' });
+
+ // The below four calls test all combinations of all sub-properties
+ $a.qtip({
+ position: {
+ target: $('.khalid'),
+ my: 'top left',
+ at: 'bottom right',
+ container: $('.edwin-odesseiron'),
+ viewport: $('.dynaheir'),
+ effect: function(api: QTip2.Api, pos: any, viewport: any) { },
+ adjust: { x: 2 }
+ }
+ });
+
+ $a.qtip({
+ position: {
+ target: [2, 2],
+ my: true,
+ at: true,
+ container: false,
+ viewport: true,
+ effect: function(api: QTip2.Api, pos: any) { return 2; },
+ adjust: { y: 2 }
+ }
+ });
+
+ $a.qtip({
+ position: {
+ target: 'mouse',
+ effect: function(api: QTip2.Api) {},
+ adjust: { x: 2, y: 2 }
+ }
+ });
+
+ $a.qtip({
+ position: {
+ target: false,
+ effect: function() {},
+ adjust: {
+ mouse: true,
+ resize: true,
+ scroll: false,
+ method: 'flipinvert'
+ }
+ }
+ });
+
+ $a.qtip({
+ position: {
+ adjust: { }
+ }
+ });
+}
+
+
+/**
+ * http://qtip2.com/options#show
+ */
+function testShowProperty() {
+ // Shorthand
+ $a.qtip({ show: true });
+ $a.qtip({ show: 'mouseenter' });
+ $a.qtip({ show: $('.korgan') });
+
+ // The below calls test all combinations of all sub-properties
+ $a.qtip({
+ show: {
+ target: $('.gorion'),
+ event: false,
+ delay: 42,
+ solo: $('.imoen'),
+ ready: true,
+ effect: function(offset) {
+ },
+ modal: true
+ }
+ });
+
+ $a.qtip({
+ show: {
+ target: false,
+ event: 'mouseenter',
+ solo: '.qtips',
+ effect: true,
+ modal: {
+ on: true,
+ blur: false,
+ escape: true,
+ stealfocus: true,
+ effect: true
+ }
+ }
+ });
+
+ $a.qtip({
+ show: {
+ solo: false,
+ modal: {
+ effect: function(state) {}
+ }
+ }
+ });
+
+ $a.qtip({
+ show: {
+ modal: {}
+ }
+ });
+}
+
+
+/**
+ * http://qtip2.com/options#hide
+ */
+function testHideProperty() {
+ // Shorthand
+ $a.qtip({ hide: 'mouseenter' });
+ $a.qtip({ hide: $('.montaron') });
+
+ // The below calls test all combinations of all sub-properties
+ $a.qtip({
+ hide: {
+ target: $('.gorion'),
+ event: false,
+ delay: 42,
+ inactive: 64,
+ fixed: true,
+ leave: 'window',
+ distance: 32,
+ effect: function(offset) {
+ },
+ }
+ });
+
+ $a.qtip({
+ hide: {
+ target: false,
+ event: 'mouseenter',
+ inactive: false,
+ leave: false,
+ distance: false,
+ effect: true,
+ }
+ });
+}
+
+
+/**
+ * http://qtip2.com/options#style
+ */
+function testStyleProperty() {
+ // Shorthand
+ $a.qtip({ style: 'kagain' });
+
+ // The below calls test all combinations of all sub-properties
+ $a.qtip({
+ style: {
+ classes: 'anomen',
+ def: true,
+ widget: true,
+ width: '24pt',
+ height: '24pt',
+ tip: 'top left'
+ }
+ });
+
+ $a.qtip({
+ show: {
+ classes: false,
+ width: 24,
+ height: 24,
+ tip: false
+ }
+ });
+
+ $a.qtip({
+ show: {
+ classes: false,
+ width: false,
+ height: false,
+ tip: {
+ corner: 'bottom right',
+ mimic: 'bottom right',
+ border: 3,
+ width: 27,
+ height: 32,
+ offset: 1
+ }
+ }
+ });
+
+ $a.qtip({
+ show: {
+ tip: {
+ corner: true,
+ mimic: true,
+ border: false
+ }
+ }
+ });
+
+ $a.qtip({
+ show: {
+ tip: { }
+ }
+ });
+}
+
+
+function baseCase() {
+ $a.qtip();
+ $a.qtip({});
+
+ $a.qtip('horatio');
+ $a.qtip('activate');
+ $a.qtip('deactivate');
+}
+
+
+/**
+ * Test with all options specified. Copied from http://qtip2.com/options#global and amended.
+ */
+function allTogetherNow() {
+ $a.qtip({
+ prerender: false,
+ id: false,
+ overwrite: true,
+ suppress: true,
+ content: {
+ title: true,
+ attr: 'title',
+ text: false,
+ button: false
+ },
+ position: {
+ my: 'top left',
+ at: 'bottom right',
+ target: false,
+ container: false,
+ viewport: false,
+ adjust: {
+ x: 0, y: 0,
+ mouse: true,
+ resize: true,
+ method: 'flip flip'
+ },
+ effect: function(api, pos, viewport) {
+ $(this).animate(pos, {
+ duration: 200,
+ queue: false
+ });
+ }
+ },
+ show: {
+ target: false,
+ event: 'mouseenter',
+ effect: true,
+ delay: 90,
+ solo: false,
+ ready: false,
+ modal: {
+ on: false,
+ effect: true,
+ blur: true,
+ escape: true
+ }
+ },
+ hide: {
+ target: false,
+ event: 'mouseleave',
+ effect: true,
+ delay: 0,
+ fixed: false,
+ inactive: false,
+ leave: 'window',
+ distance: false
+ },
+ style: {
+ classes: '',
+ widget: false,
+ width: false,
+ height: false,
+ tip: {
+ corner: true,
+ mimic: false,
+ width: 8,
+ height: 8,
+ border: true,
+ offset: 0
+ }
+ },
+ events: {
+ render: null,
+ move: null,
+ show: null,
+ hide: null,
+ toggle: null,
+ visible: null,
+ hidden: null,
+ focus: null,
+ blur: null
+ }
+ });
+}
+
+
+/**
+ * http://qtip2.com/api#api-methods.get
+ */
+function testApiGetViaObject() {
+ $a.qtip({});
+
+ var api = $a.qtip('api');
+
+ api.get('id');
+ api.get('prerender');
+ api.get('overwrite');
+ api.get('suppress');
+ api.get('metadata');
+
+ api.get('content');
+ api.get('content.text');
+ api.get('content.attr');
+ api.get('content.title');
+ api.get('content.button');
+
+ api.get('position');
+ api.get('position.my');
+ api.get('position.at');
+ api.get('position.target');
+ api.get('position.container');
+ api.get('position.viewport');
+ any)>
+ api.get('position.effect');
+ api.get('position.adjust');
+
+ api.get('show');
+ api.get('show.target');
+ api.get('show.event');
+ api.get('show.delay');
+ api.get('show.solo');
+ api.get('show.ready');
+ any)> api.get('show.effect');
+ api.get('show.modal');
+
+ api.get('hide');
+ api.get('hide.target');
+ api.get('hide.event');
+ api.get('hide.delay');
+ api.get('hide.leave');
+ api.get('hide.distance');
+ any)> api.get('hide.effect');
+
+ api.get('style');
+ api.get('style.classes');
+ api.get('style.def');
+ api.get('style.widget');
+ api.get('style.width');
+ api.get('style.height');
+ api.get('style.tip');
+
+ api.get('events');
+ api.get('events.render');
+ api.get('events.show');
+ api.get('events.hide');
+ api.get('events.toggle');
+ api.get('events.visible');
+ api.get('events.hidde');
+ api.get('events.move');
+ api.get('events.focus');
+ api.get('events.blur');
+}
+
+
+/**
+ * http://qtip2.com/api#api.updating
+ */
+function testApiGetViaString() {
+ $a.qtip({});
+
+ $a.qtip('option', 'id');
+ $a.qtip('option', 'prerender');
+ $a.qtip('option', 'overwrite');
+ $a.qtip('option', 'suppress');
+ $a.qtip('option', 'metadata');
+
+ $a.qtip('option', 'content');
+ $a.qtip('option', 'content.text');
+ $a.qtip('option', 'content.attr');
+ $a.qtip('option', 'content.title');
+ $a.qtip('option', 'content.button');
+
+ $a.qtip('option', 'position');
+ $a.qtip('option', 'position.my');
+ $a.qtip('option', 'position.at');
+ $a.qtip('option', 'position.target');
+ $a.qtip('option', 'position.container');
+ $a.qtip('option', 'position.viewport');
+ any)>
+ $a.qtip('option', 'position.effect');
+ $a.qtip('option', 'position.adjust');
+
+ $a.qtip('option', 'show');
+ $a.qtip('option', 'show.target');
+ $a.qtip('option', 'show.event');
+ $a.qtip('option', 'show.delay');
+ $a.qtip('option', 'show.solo');
+ $a.qtip('option', 'show.ready');
+ any)> $a.qtip('option', 'show.effect');
+ $a.qtip('option', 'show.modal');
+
+ $a.qtip('option', 'hide');
+ $a.qtip('option', 'hide.target');
+ $a.qtip('option', 'hide.event');
+ $a.qtip('option', 'hide.delay');
+ $a.qtip('option', 'hide.leave');
+ $a.qtip('option', 'hide.distance');
+ any)> $a.qtip('option', 'hide.effect');
+
+ $a.qtip('option', 'style');
+ $a.qtip('option', 'style.classes');
+ $a.qtip('option', 'style.def');
+ $a.qtip('option', 'style.widget');
+ $a.qtip('option', 'style.width');
+ $a.qtip('option', 'style.height');
+ $a.qtip('option', 'style.tip');
+
+ $a.qtip('option', 'events');
+ $a.qtip('option', 'events.render');
+ $a.qtip('option', 'events.show');
+ $a.qtip('option', 'events.hide');
+ $a.qtip('option', 'events.toggle');
+ $a.qtip('option', 'events.visible');
+ $a.qtip('option', 'events.hidde');
+ $a.qtip('option', 'events.move');
+ $a.qtip('option', 'events.focus');
+ $a.qtip('option', 'events.blur');
+}
+
+
+/**
+ * http://qtip2.com/api#api-methods.set
+ */
+function testApiSetViaObject() {
+
+ // TODO
+ $a.qtip({});
+
+ var api = $a.qtip('api');
+
+ api.set({
+ prerender: false,
+ id: false,
+ overwrite: true,
+ suppress: true,
+ content: {
+ title: true,
+ attr: 'title',
+ text: false,
+ button: false
+ },
+ position: {
+ my: 'top left',
+ at: 'bottom right',
+ target: false,
+ container: false,
+ viewport: false,
+ adjust: {
+ x: 0, y: 0,
+ mouse: true,
+ resize: true,
+ method: 'flip flip'
+ },
+ effect: function(api, pos, viewport) {
+ $(this).animate(pos, {
+ duration: 200,
+ queue: false
+ });
+ }
+ },
+ show: {
+ target: false,
+ event: 'mouseenter',
+ effect: true,
+ delay: 90,
+ solo: false,
+ ready: false,
+ modal: {
+ on: false,
+ effect: true,
+ blur: true,
+ escape: true
+ }
+ },
+ hide: {
+ target: false,
+ event: 'mouseleave',
+ effect: true,
+ delay: 0,
+ fixed: false,
+ inactive: false,
+ leave: 'window',
+ distance: false
+ },
+ style: {
+ classes: '',
+ widget: false,
+ width: false,
+ height: false,
+ tip: {
+ corner: true,
+ mimic: false,
+ width: 8,
+ height: 8,
+ border: true,
+ offset: 0
+ }
+ },
+ events: {
+ render: null,
+ move: null,
+ show: null,
+ hide: null,
+ toggle: null,
+ visible: null,
+ hidden: null,
+ focus: null,
+ blur: null
+ }
+ });
+
+ api.set('id', null);
+ api.set('prerender', null);
+ api.set('overwrite', null);
+ api.set('suppress', null);
+ api.set('metadata', null);
+
+ api.set('content', null);
+ api.set('content.title', null);
+ api.set('content.text', null);
+ api.set('content.attr', null);
+ api.set('content.button', null);
+
+ api.set('position', null);
+ api.set('position.my', null);
+ api.set('position.at', null);
+ api.set('position.target', null);
+ api.set('position.container', null);
+ api.set('position.viewport', null);
+ api.set('position.effect', void)> null);
+ api.set('position.adjust', null);
+
+ api.set('show', null);
+ api.set('show.target', null);
+ api.set('show.event', null);
+ api.set('show.delay', null);
+ api.set('show.solo', null);
+ api.set('show.ready', null);
+ api.set('show.effect', void)> null);
+ api.set('show.modal', null);
+
+ api.set('hide', null);
+ api.set('hide.target', null);
+ api.set('hide.event', null);
+ api.set('hide.inactive', null);
+ api.set('hide.fixed', null);
+ api.set('hide.leave', null);
+ api.set('hide.distance', null);
+ api.set('hide.effect', void)> null);
+
+ api.set('style', null);
+ api.set('style.classes', null);
+ api.set('style.def', null);
+ api.set('style.widget', null);
+ api.set('style.width', null);
+ api.set('style.height', null);
+ api.set('style.tip', null);
+
+ api.set('events', null);
+ api.set('events.render', null);
+ api.set('events.show', null);
+ api.set('events.hide', null);
+ api.set('events.toggle', null);
+ api.set('events.visible', null);
+ api.set('events.hidden', null);
+ api.set('events.move', null);
+ api.set('events.focus', null);
+ api.set('events.blur', null);
+}
+
+
+/**
+ * http://qtip2.com/api#api.updating
+ */
+function testApiSetViaString() {
+ $a.qtip({});
+
+ $a.qtip('option', {
+ prerender: false,
+ id: false,
+ overwrite: true,
+ suppress: true,
+ content: {
+ title: true,
+ attr: 'title',
+ text: false,
+ button: false
+ },
+ position: {
+ my: 'top left',
+ at: 'bottom right',
+ target: false,
+ container: false,
+ viewport: false,
+ adjust: {
+ x: 0, y: 0,
+ mouse: true,
+ resize: true,
+ method: 'flip flip'
+ },
+ effect: function(api: QTip2.Api, pos: any, viewport: any) {
+ $(this).animate(pos, {
+ duration: 200,
+ queue: false
+ });
+ }
+ },
+ show: {
+ target: false,
+ event: 'mouseenter',
+ effect: true,
+ delay: 90,
+ solo: false,
+ ready: false,
+ modal: {
+ on: false,
+ effect: true,
+ blur: true,
+ escape: true
+ }
+ },
+ hide: {
+ target: false,
+ event: 'mouseleave',
+ effect: true,
+ delay: 0,
+ fixed: false,
+ inactive: false,
+ leave: 'window',
+ distance: false
+ },
+ style: {
+ classes: '',
+ widget: false,
+ width: false,
+ height: false,
+ tip: {
+ corner: true,
+ mimic: false,
+ width: 8,
+ height: 8,
+ border: true,
+ offset: 0
+ }
+ },
+ events: {
+ render: null,
+ move: null,
+ show: null,
+ hide: null,
+ toggle: null,
+ visible: null,
+ hidden: null,
+ focus: null,
+ blur: null
+ }
+ });
+
+ $a.qtip('option', 'id', null);
+ $a.qtip('option', 'prerender', null);
+ $a.qtip('option', 'overwrite', null);
+ $a.qtip('option', 'suppress', null);
+ $a.qtip('option', 'metadata', null);
+
+ $a.qtip('option', 'content', null);
+ $a.qtip('option', 'content.title', null);
+ $a.qtip('option', 'content.text', null);
+ $a.qtip('option', 'content.attr', null);
+ $a.qtip('option', 'content.button', null);
+
+ $a.qtip('option', 'position', null);
+ $a.qtip('option', 'position.my', null);
+ $a.qtip('option', 'position.at', null);
+ $a.qtip('option', 'position.target', null);
+ $a.qtip('option', 'position.container', null);
+ $a.qtip('option', 'position.viewport', null);
+ $a.qtip('option', 'position.effect', void)> null);
+ $a.qtip('option', 'position.adjust', null);
+
+ $a.qtip('option', 'show', null);
+ $a.qtip('option', 'show.target', null);
+ $a.qtip('option', 'show.event', null);
+ $a.qtip('option', 'show.delay', null);
+ $a.qtip('option', 'show.solo', null);
+ $a.qtip('option', 'show.ready', null);
+ $a.qtip('option', 'show.effect', void)> null);
+