File: 0004-port-to-newer-mocha.patch

package info (click to toggle)
node-setimmediate 1.0.5-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192 kB
  • sloc: javascript: 267; makefile: 23
file content (55 lines) | stat: -rw-r--r-- 2,075 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Subject: Port to newer mocha
author: Bastien Roucariès <rouca@debian.org>
forwarded: not-needed

Port to newer mocha example


Index: node-setimmediate/test/browserOnly/index.html
===================================================================
--- node-setimmediate.orig/test/browserOnly/index.html
+++ node-setimmediate/test/browserOnly/index.html
@@ -8,9 +8,14 @@
     <body>
         <div id="mocha"></div>
         <script src="mocha.js"></script>
+        <script src="chai.js"></script>
         <script>mocha.setup({ ui: "bdd", slow: Infinity });</script>
         <script src="setImmediate.js"></script>
         <script src="tests.js"></script>
-        <script>mocha.run();</script>
+        <script>
+              window.onload = function() {
+                 mocha.run()
+             };
+        </script>
     </body>
 </html>
Index: node-setimmediate/test/browserOnly/tests.js
===================================================================
--- node-setimmediate.orig/test/browserOnly/tests.js
+++ node-setimmediate/test/browserOnly/tests.js
@@ -1,4 +1,4 @@
-"use strict";
+/*"use strict";*/
 /*global setImmediate: false, specify: false, window: false */
 
 function assert(condition) {
@@ -12,7 +12,7 @@ assert.strictEqual = function (x, y) {
     }
 };
 
-specify("Modal dialogs block handlers", function (done) {
+it("Modal dialogs block handlers", function (done) {
     // Try to launch the less-annoying self-closing-window modal dialog; if that's not an option, fall back to alert.
     var showTheDialog = window.showModalDialog ?
         function () {
@@ -35,7 +35,7 @@ specify("Modal dialogs block handlers",
 });
 
 if (typeof window.Worker === "function") {
-    specify("When inside a web worker context, setImmediate calls the passed handler", function (done) {
+    it("When inside a web worker context, setImmediate calls the passed handler", function (done) {
         var worker = new window.Worker("worker.js");
         worker.addEventListener("message", function (event) {
             assert.strictEqual(event.data, "TEST");