]> git.ipfire.org Git - ipfire.org.git/blob - static/scss/bootstrap-4.0.0-alpha.6/js/tests/unit/phantom.js
Added Bootstrap 4.0.0-alpha 6, new images and mockups for the new layout.
[ipfire.org.git] / static / scss / bootstrap-4.0.0-alpha.6 / js / tests / unit / phantom.js
1 /*
2 * grunt-contrib-qunit
3 * http://gruntjs.com/
4 *
5 * Copyright (c) 2014 "Cowboy" Ben Alman, contributors
6 * Licensed under the MIT license.
7 */
8
9 (function () {
10 'use strict'
11
12 // Don't re-order tests.
13 QUnit.config.reorder = false
14 // Run tests serially, not in parallel.
15 QUnit.config.autorun = false
16
17 // Send messages to the parent PhantomJS process via alert! Good times!!
18 function sendMessage() {
19 var args = [].slice.call(arguments)
20 alert(JSON.stringify(args))
21 }
22
23 // These methods connect QUnit to PhantomJS.
24 QUnit.log(function (obj) {
25 // What is this I don’t even
26 if (obj.message === '[object Object], undefined:undefined') { return }
27
28 // Parse some stuff before sending it.
29 var actual
30 var expected
31 if (!obj.result) {
32 // Dumping large objects can be very slow, and the dump isn't used for
33 // passing tests, so only dump if the test failed.
34 actual = QUnit.dump.parse(obj.actual)
35 expected = QUnit.dump.parse(obj.expected)
36 }
37 // Send it.
38 sendMessage('qunit.log', obj.result, actual, expected, obj.message, obj.source)
39 })
40
41 QUnit.testStart(function (obj) {
42 sendMessage('qunit.testStart', obj.name)
43 })
44
45 QUnit.testDone(function (obj) {
46 sendMessage('qunit.testDone', obj.name, obj.failed, obj.passed, obj.total, obj.duration)
47 })
48
49 QUnit.moduleStart(function (obj) {
50 sendMessage('qunit.moduleStart', obj.name)
51 })
52
53 QUnit.moduleDone(function (obj) {
54 if (obj.failed === 0) {
55 console.log('\r\u221A All tests passed in "' + obj.name + '" module')
56 } else {
57 console.log('\u00D7 ' + obj.failed + ' tests failed in "' + obj.name + '" module')
58 }
59 sendMessage('qunit.moduleDone', obj.name, obj.failed, obj.passed, obj.total)
60 })
61
62 QUnit.begin(function () {
63 sendMessage('qunit.begin')
64 console.log('\n\nStarting test suite')
65 console.log('================================================\n')
66 })
67
68 QUnit.done(function (obj) {
69 sendMessage('qunit.done', obj.failed, obj.passed, obj.total, obj.runtime)
70 })
71
72 }())