198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/.npmignore:
--------------------------------------------------------------------------------
1 | .git*
2 | test/
3 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/GPL-LICENSE.txt:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/MIT-LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010, 2011 Takuto Wada, http://github.com/twada/qunit-tap/
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/README.md:
--------------------------------------------------------------------------------
1 | QUnit-TAP - a TAP Output Producer Plugin for QUnit
2 | ================================
3 |
4 |
5 | *NEWS (2011/03/25)* Usage has changed. Please see USAGE section.
6 |
7 |
8 | DESCRIPTION
9 | ---------------------------------------
10 | QUnit-TAP is a simple plugin for [QUnit](http://docs.jquery.com/QUnit) to produce [TAP](http://testanything.org/) output, to run tests on CLI.
11 |
12 | With QUnit-TAP you can test your QUnit test scripts on your terminal, and you can use TAP Consumers like [prove](http://perldoc.perl.org/prove.html) for test automation.
13 |
14 | QUnit-TAP runs under headless browsers like [phantomjs](http://code.google.com/p/phantomjs/), command-line js environments (like [SpiderMonkey](https://developer.mozilla.org/en/SpiderMonkey) or [Rhino](https://developer.mozilla.org/en/Rhino)), and [CommonJS](http://commonjs.org/) environments (like [node.js](http://nodejs.org/) or [narwhal](http://narwhaljs.org/)), and of cource, runs under real browser too.
15 |
16 |
17 | DOWNLOAD
18 | ---------------------------------------
19 | * Just download [qunit-tap.js](http://github.com/twada/qunit-tap/raw/master/lib/qunit-tap.js)
20 | * or download archive from [qunit-tap archives](http://github.com/twada/qunit-tap/downloads)
21 | * or `git clone git://github.com/twada/qunit-tap.git`
22 | * or `npm install qunit-tap` if you use npm.
23 |
24 | You can use QUnit-TAP,
25 |
26 | * as a single file, copy lib/qunit-tap.js to anywhere you like.
27 | * as git submodule.
28 | * as a node.js package (via npm).
29 |
30 |
31 | USAGE
32 | ---------------------------------------
33 | Three steps to use QUnit-TAP.
34 |
35 | 1. load/require qunit.js
36 | 2. load/require qunit-tap.js
37 | 3. Call `qunitTap` function with two or three arguments. The first argument is QUnit reference, the second is print-like function for TAP output. And the third argument is object to customize default behavior. (Note that the first and second argument is mandatory, and the third argument is optional.)
38 |
39 | ### usage example 1 : embed QUnit-TAP in your HTML (e.g. to run with PhantomJS)
40 |
41 |
42 |
45 |
46 |
47 |
48 | ### usage example 2 : use QUnit-TAP with Rhino/SpiderMonkey
49 | load("path/to/qunit.js");
50 | load("path/to/qunit-tap.js");
51 |
52 | // enable TAP output
53 | qunitTap(QUnit, print); //NOTE: 'print' is Rhino/SpiderMonkey's built-in function
54 |
55 | // or customize default behavior
56 | // qunitTap(QUnit, print, {noPlan: true, showDetailsOnFailure: false});
57 |
58 | // configure QUnit to run under non-browser env.
59 | QUnit.init();
60 | QUnit.config.updateRate = 0;
61 |
62 | load("path/to/your_test.js");
63 | load("path/to/your_test2.js");
64 |
65 | QUnit.start();
66 |
67 |
68 | CONFIGURATION OPTIONS
69 | ---------------------------------------
70 | `qunitTap` function takes third optional argument as options object to customize default behavior. Customization props are,
71 |
72 | * noPlan : If true, print test plan line at the bottom after all the test points have run. Inspired by Perl's "no_plan" feature. Default is false.
73 | * showDetailsOnFailure : If true, show 'expected' and 'actual' on failure output. Default is true.
74 |
75 |
76 | TAP OUTPUT EXAMPLE
77 | ---------------------------------------
78 | 1..16
79 | # module: math module
80 | # test: add
81 | ok 1
82 | ok 2
83 | ok 3 - passing 3 args
84 | ok 4 - just one arg
85 | ok 5 - no args
86 | not ok 6 - expected: 7 result: 1
87 | not ok 7 - with message, expected: 7 result: 1
88 | ok 8
89 | ok 9 - with message
90 | not ok 10
91 | not ok 11 - with message
92 | # module: incr module
93 | # test: increment
94 | ok 12
95 | ok 13
96 | # module: TAP spec compliance
97 | # test: Diagnostic lines
98 | ok 14 - with\r
99 | # multiline
100 | # message
101 | not ok 15 - with\r
102 | # multiline
103 | # message, expected: foo\r
104 | # bar result: foo
105 | # bar
106 | not ok 16 - with\r
107 | # multiline
108 | # message, expected: foo
109 | # bar result: foo\r
110 | # bar
111 |
112 |
113 | RUNNING EXAMPLES
114 | ---------------------------------------
115 | ### prepare
116 | $ git clone git://github.com/twada/qunit-tap.git
117 | $ cd qunit-tap
118 | $ git submodule update --init
119 |
120 |
121 | ### to run with PhantomJS
122 |
123 | # assume you have built and installed phantomjs
124 | $ cd sample/js/
125 | $ ./phantomjs_test.sh
126 |
127 | # with prove
128 | $ prove phantomjs_test.sh
129 |
130 | for details, see [phantomjs_test.sh](http://github.com/twada/qunit-tap/tree/master/sample/js/phantomjs_test.sh)
131 |
132 |
133 | ### to run with Rhino/SpiderMonkey
134 |
135 | # assume you are using rhino
136 | $ cd sample/js/
137 | $ rhino run_tests.js
138 |
139 | for details, see [sample/js/](http://github.com/twada/qunit-tap/tree/master/sample/js/)
140 |
141 |
142 | ### to run under CommonJS environment
143 |
144 | # assume you are using node.js
145 | $ cd sample/commonjs/
146 | $ node test/math_test.js
147 | $ node test/incr_test.js
148 |
149 | # with prove
150 | $ prove --exec=/usr/local/bin/node test/*.js
151 |
152 | for details, see [sample/commonjs/](http://github.com/twada/qunit-tap/tree/master/sample/commonjs/)
153 |
154 |
155 | ### to use both under standard js and CommonJS environments
156 |
157 | # assume you are using node.js and rhino
158 | $ cd sample/interop/
159 | $ rhino run_tests.js
160 | $ node test/math_test.js
161 | $ node test/incr_test.js
162 |
163 | # with prove
164 | $ prove --exec=/usr/bin/rhino run_tests.js
165 | $ prove --exec=/usr/local/bin/node test/*.js
166 |
167 | for details, see [sample/interop/](http://github.com/twada/qunit-tap/tree/master/sample/interop/)
168 |
169 |
170 |
171 | TESTED ENVIRONMENTS
172 | ---------------------------------------
173 | * [phantomjs](http://code.google.com/p/phantomjs/)
174 | * [SpiderMonkey](https://developer.mozilla.org/en/SpiderMonkey)
175 | * [Rhino](https://developer.mozilla.org/en/Rhino)
176 | * [node.js](http://nodejs.org/)
177 | * [narwhal](http://narwhaljs.org/)
178 |
179 |
180 | AUTHOR
181 | ---------------------------------------
182 | Takuto Wada (takuto.wada at gmail dot com)
183 |
184 |
185 | CONTRIBUTORS
186 | ---------------------------------------
187 | * Nikita Vasilyev (http://github.com/NV)
188 | * Hiroki Kondo (http://github.com/kompiro)
189 | * Keiji Yoshimi (http://github.com/walf443)
190 |
191 |
192 | LICENSE
193 | ---------------------------------------
194 | Dual licensed under the MIT and GPLv2 licenses.
195 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/lib/qunit-tap.js:
--------------------------------------------------------------------------------
1 | /**
2 | * QUnit-TAP - A TAP Output Producer Plugin for QUnit
3 | *
4 | * http://github.com/twada/qunit-tap
5 | * version: 1.0.5
6 | *
7 | * Copyright (c) 2010, 2011 Takuto Wada
8 | * Dual licensed under the MIT (MIT-LICENSE.txt)
9 | * and GPLv2 (GPL-LICENSE.txt) licenses.
10 | *
11 | * @param qunitObject QUnit object reference.
12 | * @param printLikeFunction print-like function for TAP output (assumes line-separator is added by this function for each call).
13 | * @param options configuration options to customize default behavior.
14 | */
15 | var qunitTap = function qunitTap(qunitObject, printLikeFunction, options) {
16 | var qunitTapVersion = "1.0.5",
17 | initialCount,
18 | multipleLoggingCallbacksSupported,
19 | qu = qunitObject;
20 |
21 | if (typeof qu === 'undefined') {
22 | throw new Error('should pass QUnit object reference');
23 | }
24 | if (typeof printLikeFunction !== 'function') {
25 | throw new Error('should pass print-like function');
26 | }
27 | if (typeof qu.tap !== 'undefined') {
28 | return;
29 | }
30 |
31 | // borrowed from qunit.js
32 | var extend = function(a, b) {
33 | var prop;
34 | for (prop in b) {
35 | if (b[prop] === undefined) {
36 | delete a[prop];
37 | } else {
38 | a[prop] = b[prop];
39 | }
40 | }
41 | return a;
42 | };
43 |
44 | // using QUnit.tap as namespace.
45 | qu.tap = extend({
46 | count: 0,
47 | noPlan: false,
48 | showDetailsOnFailure: true
49 | }, options);
50 | qu.tap.puts = printLikeFunction;
51 | qu.tap.VERSION = qunitTapVersion;
52 | initialCount = qu.tap.count || 0;
53 |
54 | // detect QUnit's multipleCallbacks feature. see jquery/qunit@34f6bc1
55 | multipleLoggingCallbacksSupported =
56 | (typeof qu.config !== 'undefined'
57 | && typeof qu.config.log !== 'undefined'
58 | && typeof qu.config.done !== 'undefined'
59 | && typeof qu.config.moduleStart !== 'undefined'
60 | && typeof qu.config.testStart !== 'undefined');
61 |
62 | // borrowed from prototype.js
63 | // not required since QUnit.log receives raw data (details). see jquery/qunit@c2cde34
64 | var stripTags = function(str) {
65 | if (!str) return str;
66 | return str.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
67 | };
68 |
69 | var commentAfterLineEnd = function(str) {
70 | return str.replace(/(\r?\n)/g, '$ ');
71 | };
72 |
73 | var formDescription = function(str) {
74 | if (!str) return str;
75 | return commentAfterLineEnd(' - ' + str);
76 | };
77 |
78 | var appendDetailsTo = function(desc, details) {
79 | if (!qu.tap.showDetailsOnFailure || details.result) {
80 | return desc;
81 | }
82 | if (typeof details.expected !== 'undefined') {
83 | if (desc) desc += ', ';
84 | desc += 'expected: ';
85 | desc += details.expected;
86 | desc += ' result: ';
87 | desc += details.actual;
88 | }
89 | return desc;
90 | };
91 |
92 | qu.tap.moduleStart = function(arg) {
93 | var name = (typeof arg === 'string') ? arg : arg.name;
94 | qu.tap.puts('# module: ' + name);
95 | };
96 |
97 | qu.tap.testStart = function(arg) {
98 | var name = (typeof arg === 'string') ? arg : arg.name;
99 | qu.tap.puts('# test: ' + name);
100 | };
101 |
102 | qu.tap.diag = function(str) {
103 | qu.tap.puts(commentAfterLineEnd('# ' + str));
104 | };
105 |
106 | qu.tap.log = function() {
107 | var details, testLine, desc;
108 | switch (arguments.length) {
109 | case 1: // details
110 | details = arguments[0];
111 | break;
112 | case 2: // result, message(with tags)
113 | details = {result: arguments[0], message: stripTags(arguments[1])};
114 | break;
115 | case 3: // result, message, details
116 | details = arguments[2];
117 | break;
118 | }
119 | testLine = (details.result ? 'ok' : 'not ok') +
120 | ' ' + (qu.tap.count += 1);
121 | if (details.result && !details.message) {
122 | qu.tap.puts(testLine);
123 | return;
124 | }
125 | desc = appendDetailsTo((details.message || ''), details);
126 | qu.tap.puts(testLine + formDescription(desc));
127 | };
128 |
129 | // prop in arg: failed,passed,total,runtime
130 | qu.tap.done = function(arg) {
131 | if (! qu.tap.noPlan) {
132 | return;
133 | }
134 | qu.tap.puts((initialCount + 1) + '..' + qu.tap.count);
135 | };
136 |
137 | var addListener = function(target, name, listener) {
138 | var originalLoggingCallback = target[name];
139 | if (multipleLoggingCallbacksSupported) {
140 | originalLoggingCallback(listener);
141 | } else if (typeof originalLoggingCallback === 'function') {
142 | // add listener, not replacing former ones.
143 | target[name] = function() {
144 | var args = Array.prototype.slice.apply(arguments);
145 | originalLoggingCallback.apply(target, args);
146 | listener.apply(target, args);
147 | };
148 | }
149 | };
150 | addListener(qu, 'moduleStart', qu.tap.moduleStart);
151 | addListener(qu, 'testStart', qu.tap.testStart);
152 | addListener(qu, 'log', qu.tap.log);
153 | addListener(qu, 'done', qu.tap.done);
154 | };
155 |
156 | if (typeof exports !== 'undefined' || typeof require !== 'undefined') {
157 | // exports qunitTap function to CommonJS world
158 | exports.qunitTap = qunitTap;
159 | }
160 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "qunit-tap",
3 | "description": "A TAP Output Producer Plugin for QUnit",
4 | "version": "1.0.5",
5 | "keywords": ["TDD", "QUnit", "test", "tests", "testing", "TAP"],
6 | "homepage": "http://github.com/twada/qunit-tap",
7 | "author": {
8 | "name": "Takuto Wada",
9 | "email": "takuto.wada@gmail.com",
10 | "url": "http://github.com/twada"
11 | },
12 | "contributors": [
13 | {
14 | "name": "Nikita Vasilyev",
15 | "url": "http://elv1s.ru/"
16 | },
17 | {
18 | "name": "Hiroki Kondo",
19 | "url": "http://github.com/kompiro/"
20 | },
21 | {
22 | "name": "Keiji Yoshimi",
23 | "url": "http://github.com/walf443/"
24 | }
25 | ],
26 | "main": "./lib/qunit-tap",
27 | "directories": {
28 | "lib": "./lib",
29 | "example": "./sample"
30 | },
31 | "repository": {
32 | "type": "git",
33 | "url": "http://github.com/twada/qunit-tap.git"
34 | },
35 | "engines": [
36 | "node >=0.1.96",
37 | "narwhal >=0.2.2",
38 | "spidermonkey",
39 | "rhino",
40 | "phantomjs"
41 | ],
42 | "licenses": [
43 | {
44 | "type": "MIT",
45 | "url": "http://www.opensource.org/licenses/mit-license.php"
46 | },
47 | {
48 | "type": "GPL",
49 | "url": "http://www.opensource.org/licenses/gpl-2.0.php"
50 | }
51 | ],
52 | "bugs": {
53 | "url" : "http://github.com/twada/qunit-tap/issues"
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/commonjs/lib/incr.js:
--------------------------------------------------------------------------------
1 | var add = require('./math').add;
2 | exports.increment = function(val) {
3 | return add(val, 1);
4 | };
5 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/commonjs/lib/math.js:
--------------------------------------------------------------------------------
1 | exports.add = function() {
2 | var sum = 0, i = 0, args = arguments, l = args.length;
3 | while (i < l) {
4 | sum += args[i++];
5 | }
6 | return sum;
7 | };
8 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/commonjs/test/incr_test.js:
--------------------------------------------------------------------------------
1 | require("../test_helper");
2 | inc = require("../lib/incr").increment;
3 |
4 | QUnit.module("incr module");
5 |
6 | QUnit.test('increment' , function() {
7 | assert.equal(inc(1), 2);
8 | assert.equal(inc(-3), -2);
9 | });
10 |
11 | QUnit.start();
12 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/commonjs/test/math_test.js:
--------------------------------------------------------------------------------
1 | require("../test_helper");
2 | math = require("../lib/math");
3 |
4 | QUnit.module("math module");
5 |
6 | QUnit.test('add' , function() {
7 | var add = math.add;
8 | assert.equal(add(1, 4), 5);
9 | assert.equal(add(-3, 2), -1);
10 | assert.equal(add(1, 3, 4), 8, 'passing 3 args');
11 | assert.equal(add(2), 2, 'just one arg');
12 | assert.equal(add(), 0, 'no args');
13 |
14 | assert.equal(add(-3, 4), 7);
15 | assert.equal(add(-3, 4), 7, 'with message');
16 |
17 | assert.ok(true);
18 | assert.ok(true, 'with message');
19 | assert.ok(false);
20 | assert.ok(false, 'with message');
21 | });
22 |
23 | QUnit.start();
24 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/commonjs/test/tap_compliance_test.js:
--------------------------------------------------------------------------------
1 | require("../test_helper");
2 |
3 | QUnit.module("TAP spec compliance");
4 |
5 | QUnit.test('Diagnostic lines' , function() {
6 | assert.ok(true, "with\r\nmultiline\nmessage");
7 | assert.equal("foo\nbar", "foo\r\nbar", "with\r\nmultiline\nmessage");
8 | assert.equal("foo\r\nbar", "foo\nbar", "with\r\nmultiline\nmessage");
9 | });
10 |
11 | QUnit.start();
12 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/commonjs/test_helper.js:
--------------------------------------------------------------------------------
1 | exports = module.exports = global;
2 |
3 | var tryRequireThese = function() {
4 | var args = Array.prototype.slice.apply(arguments);
5 | for(var i=0; i < args.length; i+=1) {
6 | try {
7 | return require(args[i]);
8 | } catch(e) {
9 | // ignore
10 | }
11 | }
12 | throw new Error("cannot find moduele: " + args);
13 | };
14 |
15 | QUnit = require("../../vendor/qunit/qunit/qunit").QUnit;
16 | var qunitTap = require("../../lib/qunit-tap").qunitTap;
17 |
18 | var sys = tryRequireThese("sys", "system");
19 | for (var i in sys) exports[i] = sys[i];
20 | puts = (typeof sys.puts === 'function') ? sys.puts : sys.print;
21 |
22 | qunitTap(QUnit, puts, {noPlan: true});
23 |
24 | QUnit.init();
25 | QUnit.config.updateRate = 0;
26 |
27 | exports.assert = QUnit;
28 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/interop/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | QUnit Test Suite
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
QUnit Test Suite
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/interop/lib/incr.js:
--------------------------------------------------------------------------------
1 | (function(ns) {
2 | var math;
3 | if ( typeof exports !== "undefined" || typeof require !== "undefined" ) {
4 | math = require('./math');
5 | } else {
6 | math = ns;
7 | }
8 |
9 | ns.increment = function(val) {
10 | return math.add(val, 1);
11 | };
12 | })((typeof(exports) !== "undefined") ? exports : (this.xx || this));
13 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/interop/lib/math.js:
--------------------------------------------------------------------------------
1 | (function(ns) {
2 | ns.add = function() {
3 | var sum = 0, i = 0, args = arguments, l = args.length;
4 | while (i < l) {
5 | sum += args[i++];
6 | }
7 | return sum;
8 | };
9 | })((typeof(exports) !== "undefined") ? exports : (this.xx || this));
10 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/interop/lib/namespaces.js:
--------------------------------------------------------------------------------
1 | if (typeof xx === 'undefined') { xx = {}; }
2 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/interop/phantomjs_test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | URL=file://$PWD/index.html
3 | phantomjs run_qunit.js $URL
4 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/interop/run_qunit.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Wait until the test condition is true or a timeout occurs. Useful for waiting
3 | * on a server response or for a ui change (fadeIn, etc.) to occur.
4 | *
5 | * @param testFx javascript condition that evaluates to a boolean,
6 | * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
7 | * as a callback function.
8 | * @param onReady what to do when testFx condition is fulfilled,
9 | * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
10 | * as a callback function.
11 | * @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used.
12 | */
13 | function waitFor(testFx, onReady, timeOutMillis) {
14 | var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3001, //< Default Max Timout is 3s
15 | start = new Date().getTime(),
16 | condition = false,
17 | interval = setInterval(function() {
18 | if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) {
19 | // If not time-out yet and condition not yet fulfilled
20 | condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code
21 | } else {
22 | if(!condition) {
23 | // If condition still not fulfilled (timeout but condition is 'false')
24 | console.log("# 'waitFor()' timeout");
25 | phantom.exit(1);
26 | } else {
27 | // Condition fulfilled (timeout and/or condition is 'true')
28 | // console.log("'waitFor()' finished in " + (new Date().getTime() - start) + "ms.");
29 | typeof(onReady) === "string" ? eval(onReady) : onReady(); //< Do what it's supposed to do once the condition is fulfilled
30 | clearInterval(interval); //< Stop this interval
31 | }
32 | }
33 | }, 100); //< repeat check every 250ms
34 | };
35 |
36 |
37 | if (phantom.args.length === 0 || phantom.args.length > 2) {
38 | console.log('Usage: run-qunit.js URL');
39 | phantom.exit(1);
40 | }
41 |
42 | var page = new WebPage();
43 |
44 | // Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this")
45 | page.onConsoleMessage = function(msg) {
46 | console.log(msg);
47 | };
48 |
49 | page.open(phantom.args[0], function(status){
50 | if (status !== "success") {
51 | console.log("Unable to access network");
52 | phantom.exit(1);
53 | } else {
54 | waitFor(function(){
55 | return page.evaluate(function(){
56 | var el = document.getElementById('qunit-testresult');
57 | if (el && el.innerText.match('completed')) {
58 | return true;
59 | }
60 | return false;
61 | });
62 | }, function(){
63 | var failedNum = page.evaluate(function(){
64 | var el = document.getElementById('qunit-testresult');
65 | // console.log(el.innerText);
66 | try {
67 | return el.getElementsByClassName('failed')[0].innerHTML;
68 | } catch (e) { }
69 | return 10000;
70 | });
71 | phantom.exit((parseInt(failedNum, 10) > 0) ? 1 : 0);
72 | });
73 | }
74 | });
75 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/interop/run_tests.js:
--------------------------------------------------------------------------------
1 | load("./lib/namespaces.js");
2 | load("./lib/math.js");
3 | load("./lib/incr.js");
4 |
5 | load("../../vendor/qunit/qunit/qunit.js");
6 | load("../../lib/qunit-tap.js");
7 |
8 | qunitTap(QUnit, print, {noPlan: true});
9 |
10 | QUnit.init();
11 | QUnit.config.updateRate = 0;
12 |
13 | load("./test/math_test.js");
14 | load("./test/incr_test.js");
15 | load("./test/tap_compliance_test.js");
16 |
17 | QUnit.start();
18 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/interop/test/incr_test.js:
--------------------------------------------------------------------------------
1 | if ( typeof exports !== "undefined" || typeof require !== "undefined" ) {
2 | require("../test_helper");
3 | xx = require("../lib/incr");
4 | equal = assert.equal;
5 | }
6 |
7 | QUnit.module("incr module");
8 |
9 | QUnit.test('increment' , function() {
10 | var inc = xx.increment;
11 | equal(inc(1), 2);
12 | equal(inc(-3), -2);
13 | });
14 |
15 | if ( typeof exports !== "undefined" || typeof require !== "undefined" ) {
16 | QUnit.start();
17 | }
18 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/interop/test/math_test.js:
--------------------------------------------------------------------------------
1 | if ( typeof exports !== "undefined" || typeof require !== "undefined" ) {
2 | require("../test_helper");
3 | xx = require("../lib/math");
4 | equal = assert.equal;
5 | ok = assert.ok;
6 | }
7 |
8 | QUnit.module("math module");
9 |
10 | QUnit.test('add' , function() {
11 | var add = xx.add;
12 | equal(add(1, 4), 5);
13 | equal(add(-3, 2), -1);
14 | equal(add(1, 3, 4), 8, 'passing 3 args');
15 | equal(add(2), 2, 'just one arg');
16 | equal(add(), 0, 'no args');
17 |
18 | equal(add(-3, 4), 7);
19 | equal(add(-3, 4), 7, 'with message');
20 |
21 | ok(true);
22 | ok(true, 'with message');
23 | ok(false);
24 | ok(false, 'with message');
25 | });
26 |
27 | if ( typeof exports !== "undefined" || typeof require !== "undefined" ) {
28 | QUnit.start();
29 | }
30 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/interop/test/tap_compliance_test.js:
--------------------------------------------------------------------------------
1 | if ( typeof exports !== "undefined" || typeof require !== "undefined" ) {
2 | require("../test_helper");
3 | equal = assert.equal;
4 | ok = assert.ok;
5 | }
6 |
7 | QUnit.module("TAP spec compliance");
8 |
9 | QUnit.test('Diagnostic lines' , function() {
10 | ok(true, "with\r\nmultiline\nmessage");
11 | equal("foo\nbar", "foo\r\nbar", "with\r\nmultiline\nmessage");
12 | equal("foo\r\nbar", "foo\nbar", "with\r\nmultiline\nmessage");
13 | });
14 |
15 | if ( typeof exports !== "undefined" || typeof require !== "undefined" ) {
16 | QUnit.start();
17 | }
18 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/interop/test_helper.js:
--------------------------------------------------------------------------------
1 | exports = module.exports = global;
2 |
3 | var tryRequireThese = function() {
4 | var args = Array.prototype.slice.apply(arguments);
5 | for(var i=0; i < args.length; i+=1) {
6 | try {
7 | return require(args[i]);
8 | } catch(e) {
9 | // ignore
10 | }
11 | }
12 | throw new Error("cannot find moduele: " + args);
13 | };
14 |
15 | QUnit = require("../../vendor/qunit/qunit/qunit").QUnit;
16 | var qunitTap = require("../../lib/qunit-tap").qunitTap;
17 |
18 | var sys = tryRequireThese("sys", "system");
19 | for (var i in sys) exports[i] = sys[i];
20 | puts = (typeof sys.puts === 'function') ? sys.puts : sys.print;
21 |
22 | qunitTap(QUnit, puts, {noPlan: true});
23 |
24 | QUnit.init();
25 | QUnit.config.updateRate = 0;
26 |
27 | exports.assert = QUnit;
28 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/js/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | QUnit Test Suite
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
QUnit Test Suite
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/js/lib/incr.js:
--------------------------------------------------------------------------------
1 | if (typeof incr === 'undefined') { incr = {}; }
2 |
3 | incr.increment = function(val) {
4 | var add = math.add;
5 | return add(val, 1);
6 | };
7 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/js/lib/math.js:
--------------------------------------------------------------------------------
1 | if (typeof math === 'undefined') { math = {}; }
2 |
3 | math.add = function() {
4 | var sum = 0, i = 0, args = arguments, l = args.length;
5 | while (i < l) {
6 | sum += args[i++];
7 | }
8 | return sum;
9 | };
10 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/js/phantomjs_test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | URL=file://$PWD/index.html
3 | phantomjs run_qunit.js $URL
4 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/js/run_qunit.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Wait until the test condition is true or a timeout occurs. Useful for waiting
3 | * on a server response or for a ui change (fadeIn, etc.) to occur.
4 | *
5 | * @param testFx javascript condition that evaluates to a boolean,
6 | * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
7 | * as a callback function.
8 | * @param onReady what to do when testFx condition is fulfilled,
9 | * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
10 | * as a callback function.
11 | * @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used.
12 | */
13 | function waitFor(testFx, onReady, timeOutMillis) {
14 | var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3001, //< Default Max Timout is 3s
15 | start = new Date().getTime(),
16 | condition = false,
17 | interval = setInterval(function() {
18 | if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) {
19 | // If not time-out yet and condition not yet fulfilled
20 | condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code
21 | } else {
22 | if(!condition) {
23 | // If condition still not fulfilled (timeout but condition is 'false')
24 | console.log("# 'waitFor()' timeout");
25 | phantom.exit(1);
26 | } else {
27 | // Condition fulfilled (timeout and/or condition is 'true')
28 | // console.log("'waitFor()' finished in " + (new Date().getTime() - start) + "ms.");
29 | typeof(onReady) === "string" ? eval(onReady) : onReady(); //< Do what it's supposed to do once the condition is fulfilled
30 | clearInterval(interval); //< Stop this interval
31 | }
32 | }
33 | }, 100); //< repeat check every 250ms
34 | };
35 |
36 |
37 | if (phantom.args.length === 0 || phantom.args.length > 2) {
38 | console.log('Usage: run-qunit.js URL');
39 | phantom.exit(1);
40 | }
41 |
42 | var page = new WebPage();
43 |
44 | // Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this")
45 | page.onConsoleMessage = function(msg) {
46 | console.log(msg);
47 | };
48 |
49 | page.open(phantom.args[0], function(status){
50 | if (status !== "success") {
51 | console.log("Unable to access network");
52 | phantom.exit(1);
53 | } else {
54 | waitFor(function(){
55 | return page.evaluate(function(){
56 | var el = document.getElementById('qunit-testresult');
57 | if (el && el.innerText.match('completed')) {
58 | return true;
59 | }
60 | return false;
61 | });
62 | }, function(){
63 | var failedNum = page.evaluate(function(){
64 | var el = document.getElementById('qunit-testresult');
65 | // console.log(el.innerText);
66 | try {
67 | return el.getElementsByClassName('failed')[0].innerHTML;
68 | } catch (e) { }
69 | return 10000;
70 | });
71 | phantom.exit((parseInt(failedNum, 10) > 0) ? 1 : 0);
72 | });
73 | }
74 | });
75 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/js/run_tests.js:
--------------------------------------------------------------------------------
1 | load("./lib/math.js");
2 | load("./lib/incr.js");
3 |
4 | load("../../vendor/qunit/qunit/qunit.js");
5 | load("../../lib/qunit-tap.js");
6 |
7 | qunitTap(QUnit, print, {noPlan: true});
8 |
9 | QUnit.init();
10 | QUnit.config.updateRate = 0;
11 |
12 | load("./test/math_test.js");
13 | load("./test/incr_test.js");
14 | load("./test/tap_compliance_test.js");
15 |
16 | QUnit.start();
17 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/js/test/incr_test.js:
--------------------------------------------------------------------------------
1 | module("incr module");
2 |
3 | test('increment' , function() {
4 | var inc = incr.increment;
5 | equal(inc(1), 2);
6 | equal(inc(-3), -2);
7 | });
8 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/js/test/math_test.js:
--------------------------------------------------------------------------------
1 | module("math module");
2 |
3 | test('add' , function() {
4 | var add = math.add;
5 | equal(add(1, 4), 5);
6 | equal(add(-3, 2), -1);
7 | equal(add(1, 3, 4), 8, 'passing 3 args');
8 | equal(add(2), 2, 'just one arg');
9 | equal(add(), 0, 'no args');
10 |
11 | equal(add(-3, 4), 7);
12 | equal(add(-3, 4), 7, 'with message');
13 |
14 | ok(true);
15 | ok(true, 'with message');
16 | ok(false);
17 | ok(false, 'with message');
18 | });
19 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/sample/js/test/tap_compliance_test.js:
--------------------------------------------------------------------------------
1 | module("TAP spec compliance");
2 |
3 | test('Diagnostic lines' , function() {
4 | ok(true, "with\r\nmultiline\nmessage");
5 | equal("foo\nbar", "foo\r\nbar", "with\r\nmultiline\nmessage");
6 | equal("foo\r\nbar", "foo\nbar", "with\r\nmultiline\nmessage");
7 | });
8 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/.gitignore:
--------------------------------------------------------------------------------
1 | .project
2 | *~
3 | *.diff
4 | *.patch
5 | .DS_Store
6 | .settings
7 |
8 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/History.md:
--------------------------------------------------------------------------------
1 |
2 | 1.2.0 / 2011-11-24
3 | ==================
4 |
5 | * remove uses of equals(), as it's deprecated in favor of equal()
6 | * Code review of "Allow objects with no prototype to be tested against object literals."
7 | * Allow objects with no prototype to tested against object literals.
8 | * Fix IE8 "Member not found" error
9 | * Using node-qunit port, the start/stop function are not exposed so we need to prefix any call to them with 'QUnit'. Aka: start() -> QUnit.start()
10 | * Remove the 'let teardown clean up globals test' - IE<9 doesn't support (==buggy) deleting window properties, and that's not worth the trouble, as everything else passes just fine. Fixes #155
11 | * Fix globals in test.js, part 2
12 | * Fix globals in test.js. ?tell wwalser to use ?noglobals everyonce in a while
13 | * Extend readme regarding release process
14 |
15 | 1.1.0 / 2011-10-11
16 | ==================
17 |
18 | * Fixes #134 - Add a window.onerror handler. Makes uncaught errors actually fail the testsuite, instead of going by unnoticed.
19 | * Whitespace cleanup
20 | * Merge remote branch 'trevorparscal/master'
21 | * Fixed IE compatibility issues with using toString on NodeList objects, which in some browsers results in [object Object] rather than [object NodeList]. Now using duck typing for NodeList objects based on the presence of length, length being a number, presence of item method (which will be typeof string in IE and function in others, so we just check that it's not undefined) and that item(0) returns the same value as [0], unless it's empty, in which case item(0) will return 0, while [0] would return undefined. Tested in IE6, IE8, Firefox 6, Safari 5 and Chrome 16.
22 | * Update readme with basic notes on releases
23 | * More whitespace/parens cleanup
24 | * Check if setTimeout is available before trying to delay running the next task. Fixes #160
25 | * Whitespace/formatting fix, remove unnecessary parens
26 | * Use alias for Object.prototype.toString
27 | * Merge remote branch 'trevorparscal/master'
28 | * Merge remote branch 'wwalser/recursionBug'
29 | * Default 'expected' to null in asyncTest(), same as in test() itself.
30 | * Whitespace cleanup
31 | * Merge remote branch 'mmchaney/master'
32 | * Merge remote branch 'Krinkle/master'
33 | * Using === instead of ==
34 | * Added more strict array type detection for dump output, and allowed NodeList objects to be output as arrays
35 | * Bump post-release version
36 | * Fixes a bug where after an async test, assertions could move between test cases because of internal state (config.current) being incorrectly set
37 | * Simplified check for assertion count and adjusted whitespace
38 | * Redo of fixing issue #156 (Support Object.prototype extending environment). * QUnit.diff: Throws exception without this if Object.prototype is set (Property 'length' of undefined. Since Object.prototype.foo doesn't have a property 'rows') * QUnit.url: Without this fix, if Object.prototype.foo is set, the url will be set to ?foo=...&the=rest. * saveGlobals: Without this fix, whenever a member is added to Object.prototype, saveGlobals will think it was a global variable in this loop. --- This time using the call method instead of obj.hasOwnProperty(key), which may fail if the object has that as it's own property (touché!).
39 | * Handle expect(0) as expected, i.e. expect(0); ok(true, foo); will cause a test to fail
40 |
41 | 1.0.0 / 2011-10-06
42 | ==================
43 |
44 | * Make QUnit work with TestSwarm
45 | * Run other addons tests as composite addon demo. Need to move that to /test folder once this setup actually works
46 | * Add-on: New assertion-type: step()
47 | * added parameter to start and stop allowing a user to increment/decrement the semaphore more than once per call
48 | * Update readmes with .md extension for GitHub to render them as markdown
49 | * Update close-enough addon to include readme and match (new) naming convetions
50 | * Merge remote branch 'righi/close-enough-addon'
51 | * Canvas addon: Update file referneces
52 | * Update canvas addon: Rename files and add README
53 | * Merge remote branch 'wwalser/composite'
54 | * Fix #142 - Backslash characters in messages should not be escaped
55 | * Add module name to testStart and testDone callbacks
56 | * Removed extra columns in object literals. Closes #153
57 | * Remove dead links in comments.
58 | * Merge remote branch 'wwalser/multipleCallbacks'
59 | * Fixed syntax error and CommonJS incompatibilities in package.json
60 | * Allow multiple callbacks to be registered.
61 | * Add placeholder for when Safari may end up providing useful error handling
62 | * changed file names to match addon naming convention
63 | * Whitespace
64 | * Created the composite addon.
65 | * Using array and object literals.
66 | * Issue #140: Make toggle system configurable.
67 | * Merge remote branch 'tweetdeck/master'
68 | * Adds the 'close enough' addon to determine if numbers are acceptably close enough in value.
69 | * Fix recursion support in jsDump, along with tests. Fixes #63 and #100
70 | * Adding a QUnit.config.altertitle flag which will allow users to opt-out of the functionality introduced in 60147ca0164e3d810b8a9bf46981c3d9cc569efc
71 | * Refactor window.load handler into QUnit.load, makes it possible to call it manually.
72 | * More whitespace cleanup
73 | * Merge remote branch 'erikvold/one-chk-in-title'
74 | * Whitespace
75 | * Merge remote branch 'wwalser/syncStopCalls'
76 | * Introducing the first QUnit addon, based on https://github.com/jquery/qunit/pull/84 - adds QUnit.pixelEqual assertion method, along with example tests.
77 | * Remove config.hidepassed setting in test.js, wasn't intended to land in master.
78 | * Expose QUnit.config.hidepassed setting. Overrides sessionStorage and enables enabling the feature programmatically. Fixes #133
79 | * Fix formatting (css whitespace) for tracebacks.
80 | * Expose extend, id, and addEvent methods.
81 | * minor comment typo correction
82 | * Ignore Eclipse WTP .settings
83 | * Set 'The jQuery Project' as author in package.json
84 | * Fixes a bug where synchronous calls to stop would cause tests to end before start was called again
85 | * Point to planning testing wiki in readme
86 | * only add one checkmark to the document.title
87 | * Escape the stacktrace output before setting it as innerHTML, since it tends to contain `<` and `>` characters.
88 | * Cleanup whitespace
89 | * Run module.teardown before checking for pollution. Fixes #109 - noglobals should run after module teardown
90 | * Fix accidental global variable "not"
91 | * Update document.title status to use more robust unicode escape sequences, works even when served with non-utf-8-charset.
92 | * Modify document.title when suite is done to show success/failure in tab, allows you to see the overall result without seeing the tab content.
93 | * Merge pull request #107 from sexyprout/master
94 | * Set a generic font
95 | * Add/update headers
96 | * Drop support for deprecated #main in favor of #qunit-fixture. If this breaks your testsuite, replace id="main" with id="qunit-fixture". Fixes #103
97 | * Remove the same key as the one being set. Partial fix for #101
98 | * Don't modify expected-count when checking pollution. The failing assertion isn't expected, so shouldn't be counted. And if expect wasn't used, the count is misleading.
99 | * Fix order of noglobals check to produce correct introduced/delete error messages
100 | * Prepend module name to sessionStorage keys to avoid conflicts
101 | * Store filter-tests only when checked
102 | * Write to sessionStorage only bad tests
103 | * Moved QUnit.url() defintion after QUnit properties are merged into the global scope. Fixes #93 - QUnit url/extend function breaking urls in jQuery ajax test component
104 | * Add a "Rerun" link to each test to replce the dblclick (still supported, for now).
105 | * Fixed the regex for parsing the name of a test when double clicking to filter.
106 | * Merge remote branch 'scottgonzalez/url'
107 | * Added checkboxes to show which flags are currently on and allow toggling them.
108 | * Retain all querystring parameters when filtering a test via double click.
109 | * Added better querystring parsing. Now storing all querystring params in QUnit.urlParams so that we can carry the params forward when filtering to a specific test. This removes the ability to specify multiple filters.
110 | * Make reordering optional (QUnit.config.reorder = false) and optimize "Hide passed tests" mode by also hiding "Running [testname]" entries.
111 | * Added missing semicolons and wrapped undefined key in quotes.
112 | * Optimize test hiding, add class on page load if stored in sessionStorage
113 | * Optimize the hiding of passed tests.
114 | * Position test results above test list, making it visible without ever having to scroll. Create a placeholder to avoid pushing down results later.
115 | * Don't check for existing qunit-testresult element, it gets killed on init anyway.
116 | * Added URL flag ?notrycatch (ala ?noglobals) for debugging exceptions. Won't try/catch test code, giving better debugging changes on the original exceptions. Fixes #72
117 | * Always show quni-toolbar (if at all specified), persist checkbox via sessionStorage. Fixes #47
118 | * Use non-html testname for calls to fail(). Fixes #77
119 | * Overhaul of QUnit.callbacks. Consistent single argument with related properties, with additonal runtime property for QUnit.done
120 | * Extended test/logs.html to capture more of the callbacks.
121 | * Fixed moduleStart/Done callbacks. Added test/logs.html to test these callbacks. To be extended.
122 | * Update copyright and license header. Fixes #61
123 | * Formatting fix.
124 | * Use a semaphore to synchronize stop() and start() calls. Fixes #76
125 | * Merge branch 'master' of https://github.com/paulirish/qunit into paulirish-master
126 | * Added two tests for previous QUnit.raises behaviour. For #69
127 | * add optional 2. arg to QUnit.raises #69.
128 | * fix references inside Complex Instances Nesting to what was originally intended.
129 | * Qualify calls to ok() in raises() for compability with CLI enviroments.
130 | * Fix done() handling, check for blocking, not block property
131 | * Fix moduleStart/Done and done callbacks.
132 | * Replacing sessionStorage test with the one from Modernizr/master (instead of current release). Here's hoping it'll work for some time.
133 | * Updated test for availibility of sessionStorage, based on test from Modernizr. Fixes #64
134 | * Defer test execution when previous run passed, persisted via sessionStorage. Fixes #49
135 | * Refactored module handling and queuing to enable selective defer of test runs.
136 | * Move assertions property from config to Test
137 | * Move expected-tests property from config to Test
138 | * Refactored test() method to delegate to a Test object to encapsulate all properties and methods of a single test, allowing further modifications.
139 | * Adding output of sourcefile and linenumber of failed assertions (except ok()). Only limited cross-browser support for now. Fixes #60
140 | * Drop 'hide missing tests' feature. Fixes #48
141 | * Adding readme. Fixes #58
142 | * Merge branch 'prettydiff'
143 | * Improve jsDump output with formatted diffs.
144 | * Cleanup whitespace
145 | * Cleanup whitespace
146 | * Added additional guards around browser specific code and cleaned up jsDump code
147 | * Added guards around tests which are only for browsers
148 | * cleaned up setTimeout undefined checking and double done on test finish
149 | * fixing .gitignore
150 | * making window setTimeout query more consistent
151 | * Moved expect-code back to beginning of function, where it belongs. Fixes #52
152 | * Bread crumb in header: Link to suite without filters, add link to current page based on the filter, if present. Fixes #50
153 | * Make the toolbar element optional when checking for show/hide of test results. Fixes #46
154 | * Adding headless.html to manually test logging and verify that QUnit works without output elements. Keeping #qunit-fixture as a few tests actually use that.
155 | * Fix for QUnit.moduleDone, get rid of initial bogus log. Fixes #33
156 | * Pass raw data (result, message, actual, expected) as third argument to QUnit.log. Fixes #32
157 | * Dump full exception. Not pretty, but functional (see issue Pretty diff for pretty output). Fixes #31
158 | * Don't let QUnit.reset() cause assertions to run. Manually applied from Scott Gonzalez branch. Fixes #34
159 | * Added missing semicolons. Fixes #37
160 | * Show okay/failed instead of undefined. Fixes #38
161 | * Expose push as QUnit.push to build custom assertions. Fixes #39
162 | * Respect filter pass selection when writing new results. Fixes #43
163 | * Cleanup tests, removing asyncTest-undefined check and formatting
164 | * Reset: Fall back to innerHTML when jQuery isn't available. Fixes #44
165 | * Merge branch 'master' of github.com:jquery/qunit
166 | * reset doesn't exist here - fixes #28.
167 | * - less css cruft, better readability - replaced inline style for test counts with "counts" class - test counts now use a "failed"/"passed" vs "pass"/"fail", shorter/more distinct selectors - pulled all test counts styling together and up (they're always the same regardless of section pass/fail state)
168 | * Adding .gitignore file
169 | * Removing diff test - diffing works fine, as the browser collapses whitespace in its output, but the test can't do that and isn't worth fixing.
170 | * Always synchronize the done-step (it'll set the timeout when necessary), fixes timing race conditions.
171 | * Insert location.href as an anchor around the header. Fixes issue #29
172 | * - kill double ;; in escapeHtml. oops
173 | * Removed html escaping from QUnit.diff, as input is already escaped, only leads to double escaping. Replaced newlines with single whitespace.
174 | * Optimized and cleaned up CSS file
175 | * Making the reset-method non-global (only module, test and assertions should be global), and fixing the fixture reset by using jQuery's html() method again, doesn't work with innerHTML, yet
176 | * Introducing #qunit-fixture element, deprecating the (never documented) #main element. Doesn't require inline styles and is now independent of jQuery.
177 | * Ammending previous commit: Remove jQuery-core specific resets (will be replaced within jQuery testsuite). Fixes issue #19 - QUnit.reset() removes global jQuery ajax event handlers
178 | * Remove jQuery-core specific resets (will be replaced within jQuery testsuite). Fixes issue #19 - QUnit.reset() removes global jQuery ajax event handlers
179 | * Cleaning up rubble from the previous commit.
180 | * Added raises assertion, reusing some of kennsnyder's code.
181 | * Merged kensnyder's object detection code. Original message: Streamlined object detection and exposed QUnit.objectType as a function.
182 | * Fixed some bad formatting.
183 | * Move various QUnit properties below the globals-export to avoid init becoming a global method. Fixes issue #11 - Remove 'init' function from a global namespace
184 | * Improved output when expected != actual: Output both only then, and add a diff. Fixes issue #10 - Show diff if equal() or deepEqual() failed
185 | * Expand failed tests on load. Fixes issue #8 - Failed tests expanded on load
186 | * Set location.search for url-filtering instead of location.href. Fixes issue #7 - Modify location.search instead of location.href on test double-click
187 | * Add QUnit.begin() callback. Fixes issue #6 - Add 'start' callback.
188 | * add css style for result (".test-actual") in passed tests
189 | * Fixed output escaping by using leeoniya's custom escaping along with innerHTML. Also paves the way for outputting diffs.
190 | * Cleanup
191 | * Revert "Revert part of bad merge, back to using createTextNode"
192 | * Revert part of bad merge, back to using createTextNode
193 | * Fixed doubleclick-handler and filtering to rerun only a single test.
194 | * Add ability to css style a test's messages, expected and actual results. Merged from Leon Sorokin (leeoniya).
195 | * Remove space between module name and colon
196 | * - removed "module" wording from reports (unneeded and cluttery) - added and modified css to make module & test names styleable
197 | * Logging support for Each test can extend the module testEnvironment
198 | * Fixing whitespace
199 | * Update tests to use equal() and deepEqual() rather than the deprecated equals() and same()
200 | * Consistent argument names for deepEqual
201 | * Skip DOM part of jsDump test if using a SSJS environment without a DOM
202 | * Improve async testing by creating the result element before running the test, updating it later. If the test fails, its clear which test is the culprit.
203 | * Add autostart option to config. Set via QUnit.config.autostart = false; start later via QUnit.start()
204 | * Expose QUnit.config, but don't make config a global
205 | * Expose QUnit.config as global to make external workarounds easier
206 | * Merge branch 'asyncsetup'
207 | * Allowing async setup and teardown. Fixes http://github.com/jquery/qunit/issues#issue/20
208 | * Always output expected and actual result (no reason not to). Fixes http://github.com/jquery/qunit/issues#issue/21
209 | * More changes to the detection of types in jsDump's typeOf.
210 | * Change the typeOf checks in QUnit to be more accurate.
211 | * Added test for jsDump and modified its options to properly output results when document.createTextNode is used; currently tests for DOM elements cause a stackoverflow error in IEs, works fine, with the correct output, elsewhere
212 | * Always use jsDump to output result objects into messages, making the output for passing assertions more useful
213 | * Make it so that the display is updated, at least, once a second - also prevents scripts from executing for too long and causing problems.
214 | * added tests and patch for qunit.equiv to avoid circular references in objects and arrays
215 | * No reason to continue looping, we can stop at this point. Thanks to Chris Thatcher for the suggestion.
216 | * Use createTextNode instead of innerHTML for showing test result since expected and actual might be something that looks like a tag.
217 | * 'Test card' design added
218 | * switched green to blue for top-level pass + reduced padding
219 | * Bringing the QUnit API in line with the CommonJS API.
220 | * Explicitly set list-style-position: inside on result LIs.
221 | * Madness with border-radius.
222 | * Corrected banner styles for new class names
223 | * Added rounded corners and removed body rules for embedded tests
224 | * Resolving merge conflicts.
225 | * added colouring for value summary
226 | * adding some extra text colours
227 | * added styles for toolbar
228 | * added new styles
229 | * IE 6 and 7 weren't respecting the CSS rules for the banner, used a different technique instead.
230 | * Went a bit further and made extra-sure that the target was specified correctly.
231 | * Fixed problem where double-clicking an entry in IE caused an error to occur.
232 | * Path for http://dev.jquery.com/ticket/5426 - fix the microformat test result
233 | * Fixed test() to use 'expected' 2nd param
234 | * Remove the named function expressions, to stop Safari 2 from freaking out. Fixes #5.
235 | * Each test can extend the module testEnvironment
236 | * Extra test for current test environment
237 | * Make the current testEnvironment available to utility functions
238 | * typeOf in QUnit.jsDump now uses QUnit.is
239 | * hoozit in QUnit.equiv now uses QUnit.is
240 | * Properly set label attributes.
241 | * Some minor tweaks to RyanS' GETParams change.
242 | * left a console.log in :(
243 | * Took into account a fringe case when using qunit with testswarm. Trying to run all the tests with the extra url params from testswarm would make qunit look for a testsuite that did not exist
244 | * need to set config.currentModule to have correct names and working filters
245 | * Support logging of testEnvironment
246 | * async tests aren't possible on rhino
247 | * Fixed a missing QUnit.reset().
248 | * The QUnit. prefix was missing from the uses of the start() method.
249 | * Merged lifecycle object into testEnvironment
250 | * "replacing totally wrong diff algorithm with a working one" Patch from kassens (manually applied).
251 | * fixing jslint errors in test.js
252 | * Fixed: testDone() was always called with 0 failures in CommonJS mode
253 | * Fixed: moduleDone() was invoked on first call to module()
254 | * Added a new asyncTest method - removes the need for having to call start() at the beginning of an asynchronous test.
255 | * Added support for expected numbers in the test method.
256 | * Fixed broken dynamic loading of tests (can now dynamically load tests and done still works properly).
257 | * Simplified the logic for calling 'done' and pushing off new tests - was causing too many inconsistencies otherwise.
258 | * Simplified the markup for the QUnit test test suite.
259 | * Realized that it's really easy to handle the case where stop() has been called and then an exception is thrown.
260 | * Added in better logging support. Now handle moduleStart/moduleDone and testStart/testDone. Also make sure that done only fires once at the end.
261 | * Made it so that you can reset the suite to an initial state (at which point tests can be dynamically loaded and run, for example).
262 | * Re-worked QUnit to handle dynamic loading of additional code (the 'done' code will be re-run after additional code is loaded).
263 | * Removed the old SVN version stuff.
264 | * Moved the QUnit source into a separate directory and updated the test suite/packages files.
265 | * Added in CommonJS support for exporting the QUnit functionality.
266 | * Missing quote from package.json.
267 | * Fixed trailing comma in package.json.
268 | * Added a CommonJS/Narwhal package.json file.
269 | * Accidentally reverted the jsDump/equiv changes that had been made.
270 | * Hide the filter toolbar if it's not needed. Also exposed the jsDump and equiv objects on QUnit.
271 | * Retooled the QUnit CSS to be more generic.
272 | * Renamed the QUnit files from testrunner/testsuite to QUnit.
273 | * Expose QUnit.equiv and QUnit.jsDump in QUnit.
274 | * Moved the QUnit test directory into the QUnit directory.
275 | * Reworked the QUnit CSS (moved jQuery-specific stuff out, made all the other selectors more specific).
276 | * Removed the #main reset for non-jQuery code (QUnit.reset can be overwritten with your own reset code).
277 | * Moved the QUnit toolbar inline.
278 | * Switched to using a qunit- prefix for special elements (banner, userAgent, and tests).
279 | * Missed a case in QUnit where an element was assumed to exist.
280 | * QUnit's isSet and isObj are no longer needed - you should use same instead.
281 | * Make sure that QUnit's equiv entity escaping is enabled by default (otherwise the output gets kind of crazy).
282 | * Refactored QUnit, completely reorganized the structure of the file. Additionally made it so that QUnit can run outside of a browser (inside Rhino, for example).
283 | * Removed some legacy and jQuery-specific test methods.
284 | * Added callbacks for tests and modules. It's now possible to reproduce the full display of the testrunner without using the regular rendering.
285 | * QUnit no longer depends upon rendering the results (it can work simply by using the logging callbacks).
286 | * Made QUnit no longer require jQuery (it is now a standalone, framework independent, test runner).
287 | * Reverted the noglobals changed from QUnit - causing chaos in the jQuery test suite.
288 | * qunit: removed noglobals flag, instead always check for globals after teardown; if a test has to introduce a global "myVar", use delete window.myVar in teardown or at the end of a test
289 | * qunit: don't child selectors when IE should behave nicely, too
290 | * qunit: improvment for the test-scope: create a new object and call setup, the test, and teardown in the scope of that object - allows you to provide test fixtures to each test without messing with global data; kudos to Martin Häcker for the contribution
291 | * qunit: added missing semicolons
292 | * qunit: fixed a semicolon, that should have been a comma
293 | * QUnit: implemented error handling for Opera as proposed by #3628
294 | * qunit: fix for http://dev.jquery.com/ticket/3215 changing wording of testresults, to something more positive (x of y passed, z failed)
295 | * QUnit: testrunner.js: Ensures equality of types (String, Boolean, Number) declared with the 'new' prefix. See comments #3, #4 and #5 on http://philrathe.com/articles/equiv
296 | * qunit: wrap name of test in span when a module is used for better styling
297 | * qunit: auto-prepend default mark (#header, #banner, #userAgent, #tests) when not present
298 | * Landing some changes to add logging to QUnit (so that it's easier to hook in to when a test finishes).
299 | * Added checkbox for hiding missing tests (tests that fail with the text 'missing test - untested code is broken code')
300 | * qunit: eol-style:native and mime-type
301 | * HTML being injected for the test result wasn't valid HTML.
302 | * qunit: setting mimetype for testsuite.css
303 | * qunit: update to Ariel's noglobals patch to support async tests as well
304 | * Landing Ariel's change - checks for global variable leakage.
305 | * qunit: run module-teardown in its own synchronize block to synchronize with async tests (ugh)
306 | * qunit: same: equiv - completely refactored in the testrunner.
307 | * testrunner.js: - Update equiv to support Date and RegExp. - Change behavior when comparing function: - abort when in an instance of Object (when references comparison failed) - skip otherwise (like before)
308 | * qunit: code refactoring and cleanup
309 | * QUnit: update equiv to latest version, handling multiple arguments and NaN, see http://philrathe.com/articles/equiv
310 | * QUnit: cleanup, deprecating compare, compare2 and serialArray: usage now throws an error with a helpful message
311 | * QUnit: optional timeout argument for stop, while making tests undetermined, useful for debugging
312 | * QUnit: added toolbar with "hide passed tests" checkbox to help focus on failed tests
313 | * QUnit: minor output formatting
314 | * QUnit: adding same-assertion for a recursive comparsion of primite values, arrays and objects, thanks to Philippe Rathé for the contribution, including tests
315 | * QUnit: adding same-assertion for a recursive comparsion of primite values, arrays and objects, thanks to Philippe Rathé for the contribution, including tests
316 | * QUnit: adding same-assertion for a recursive comparsion of primite values, arrays and objects, thanks to Philippe Rathé for the contribution, including tests
317 | * qunit: use window.load to initialize tests, allowing other code to run on document-ready before starting to run tests
318 | * qunit: allow either setup or teardown, instead of both or nothing
319 | * qunit: make everything private by default, expose only public API; removed old timeout-option (non-deterministic, disabled for a long time anyway); use local $ reference instead of global jQuery reference; minor code cleanup (var config instead of _config; queue.shift instead of slice)
320 | * qunit: added support for module level setup/teardown callbacks
321 | * qunit: modified example for equals to avoid confusion with parameter ordering
322 | * qunit: added id/classes to result element to enable integration with browser automation tools, see http://docs.jquery.com/QUnit#Integration_into_Browser_Automation_Tools
323 | * qunit: replaced $ alias with jQuery (merged from jquery/test/data/testrunner.js)
324 | * qunit: fixed inline documentation for equals
325 | * qunit testrunner - catch and log possible error during reset()
326 | * QUnit: Switched out Date and Rev for Id.
327 | * qunit: when errors are thrown in a test, the message is successfully show on all browsers.
328 | * qunit: added license header
329 | * qunit: moved jquery testrunner to top-level project, see http://docs.jquery.com/QUnit
330 | * Share project 'qunit' into 'https://jqueryjs.googlecode.com/svn'
331 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/README.md:
--------------------------------------------------------------------------------
1 | [QUnit](http://docs.jquery.com/QUnit) - A JavaScript Unit Testing framework.
2 | ================================
3 |
4 | QUnit is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery
5 | project to test its code and plugins but is capable of testing any generic
6 | JavaScript code (and even capable of testing JavaScript code on the server-side).
7 |
8 | QUnit is especially useful for regression testing: Whenever a bug is reported,
9 | write a test that asserts the existence of that particular bug. Then fix it and
10 | commit both. Every time you work on the code again, run the tests. If the bug
11 | comes up again - a regression - you'll spot it immediately and know how to fix
12 | it, because you know what code you just changed.
13 |
14 | Having good unit test coverage makes safe refactoring easy and cheap. You can
15 | run the tests after each small refactoring step and always know what change
16 | broke something.
17 |
18 | QUnit is similar to other unit testing frameworks like JUnit, but makes use of
19 | the features JavaScript provides and helps with testing code in the browser, eg.
20 | with it's stop/start facilities for testing asynchronous code.
21 |
22 | If you are interested in helping developing QUnit, you are in the right place.
23 | For related discussions, visit the
24 | [QUnit and Testing forum](http://forum.jquery.com/qunit-and-testing).
25 |
26 | Planning for a qunitjs.com site and other testing tools related work now happens
27 | on the [jQuery Testing Team planning wiki](http://jquerytesting.pbworks.com/w/page/41556026/FrontPage).
28 |
29 | Releases
30 | --------
31 |
32 | Install git-extras and run `git changelog` to update History.md.
33 | Update qunit/qunit.js|css to the release version, commit and tag, update them
34 | again to the next version, commit and push commits and tags.
35 |
36 | Put the 'v' in front of the tag (unlike the 1.1.0 release). Clean up the changelog,
37 | removing merge commits or whitespace cleanups.
38 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/canvas/README.md:
--------------------------------------------------------------------------------
1 | Canvas - A QUnit Addon For Testing Canvas Rendering
2 | ================================
3 |
4 | This addon for QUnit adds a pixelEqual method that allows you to assert
5 | individual pixel values in a given canvas.
6 |
7 | Usage:
8 |
9 | pixelEqual(canvas, x, y, r, g, b, a, message)
10 |
11 | Where:
12 |
13 | * canvas: Reference to a canvas element
14 | * x, y: Coordinates of the pixel to test
15 | * r, g, b, a: The color and opacity value of the pixel that you except
16 | * message: Optional message, same as for other assertions
17 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/canvas/canvas-test.js:
--------------------------------------------------------------------------------
1 | test("Canvas pixels", function () {
2 | var canvas = document.getElementById('qunit-canvas'), context;
3 | try {
4 | context = canvas.getContext('2d');
5 | } catch(e) {
6 | // propably no canvas support, just exit
7 | return;
8 | }
9 | context.fillStyle = 'rgba(0, 0, 0, 0)';
10 | context.fillRect(0, 0, 5, 5);
11 | QUnit.pixelEqual(canvas, 0, 0, 0, 0, 0, 0);
12 | context.clearRect(0,0,5,5);
13 | context.fillStyle = 'rgba(255, 0, 0, 0)';
14 | context.fillRect(0, 0, 5, 5);
15 | QUnit.pixelEqual(canvas, 0, 0, 0, 0, 0, 0);
16 | context.clearRect(0,0,5,5);
17 | context.fillStyle = 'rgba(0, 255, 0, 0)';
18 | context.fillRect(0, 0, 5, 5);
19 | QUnit.pixelEqual(canvas, 0, 0, 0, 0, 0, 0);
20 | context.clearRect(0,0,5,5);
21 | context.fillStyle = 'rgba(0, 0, 255, 0)';
22 | context.fillRect(0, 0, 5, 5);
23 | QUnit.pixelEqual(canvas, 0, 0, 0, 0, 0, 0);
24 | context.clearRect(0,0,5,5);
25 |
26 | context.fillStyle = 'rgba(0, 0, 0, 0.5)';
27 | context.fillRect(0, 0, 5, 5);
28 | QUnit.pixelEqual(canvas, 0, 0, 0, 0, 0, 127);
29 | context.clearRect(0,0,5,5);
30 | context.fillStyle = 'rgba(255, 0, 0, 0.5)';
31 | context.fillRect(0, 0, 5, 5);
32 | QUnit.pixelEqual(canvas, 0, 0, 255, 0, 0, 127);
33 | context.clearRect(0,0,5,5);
34 | context.fillStyle = 'rgba(0, 255, 0, 0.5)';
35 | context.fillRect(0, 0, 5, 5);
36 | QUnit.pixelEqual(canvas, 0, 0, 0, 255, 0, 127);
37 | context.clearRect(0,0,5,5);
38 | context.fillStyle = 'rgba(0, 0, 255, 0.5)';
39 | context.fillRect(0, 0, 5, 5);
40 | QUnit.pixelEqual(canvas, 0, 0, 0, 0, 255, 127);
41 | context.clearRect(0,0,5,5);
42 |
43 | context.fillStyle = 'rgba(0, 0, 0, 0.5)';
44 | context.fillRect(0, 0, 5, 5);
45 | QUnit.pixelEqual(canvas, 2, 2, 0, 0, 0, 127);
46 | context.clearRect(0,0,5,5);
47 | context.fillStyle = 'rgba(255, 0, 0, 0.5)';
48 | context.fillRect(0, 0, 5, 5);
49 | QUnit.pixelEqual(canvas, 2, 2, 255, 0, 0, 127);
50 | context.clearRect(0,0,5,5);
51 | context.fillStyle = 'rgba(0, 255, 0, 0.5)';
52 | context.fillRect(0, 0, 5, 5);
53 | QUnit.pixelEqual(canvas, 2, 2, 0, 255, 0, 127);
54 | context.clearRect(0,0,5,5);
55 | context.fillStyle = 'rgba(0, 0, 255, 0.5)';
56 | context.fillRect(0, 0, 5, 5);
57 | QUnit.pixelEqual(canvas, 2, 2, 0, 0, 255, 127);
58 | context.clearRect(0,0,5,5);
59 |
60 | context.fillStyle = 'rgba(0, 0, 0, 1)';
61 | context.fillRect(0, 0, 5, 5);
62 | QUnit.pixelEqual(canvas, 4, 4, 0, 0, 0, 255);
63 | context.clearRect(0,0,5,5);
64 | context.fillStyle = 'rgba(255, 0, 0, 1)';
65 | context.fillRect(0, 0, 5, 5);
66 | QUnit.pixelEqual(canvas, 4, 4, 255, 0, 0, 255);
67 | context.clearRect(0,0,5,5);
68 | context.fillStyle = 'rgba(0, 255, 0, 1)';
69 | context.fillRect(0, 0, 5, 5);
70 | QUnit.pixelEqual(canvas, 4, 4, 0, 255, 0, 255);
71 | context.clearRect(0,0,5,5);
72 | context.fillStyle = 'rgba(0, 0, 255, 1)';
73 | context.fillRect(0, 0, 5, 5);
74 | QUnit.pixelEqual(canvas, 4, 4, 0, 0, 255, 255);
75 | context.clearRect(0,0,5,5);
76 | });
77 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/canvas/canvas.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | QUnit Test Suite - Canvas Addon
6 |
7 |
8 |
9 |
10 |
11 |
12 |
QUnit Test Suite - Canvas Addon
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/canvas/qunit-canvas.js:
--------------------------------------------------------------------------------
1 | QUnit.extend( QUnit, {
2 | pixelEqual: function(canvas, x, y, r, g, b, a, message) {
3 | var actual = Array.prototype.slice.apply(canvas.getContext('2d').getImageData(x, y, 1, 1).data), expected = [r, g, b, a];
4 | QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
5 | }
6 | });
7 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/close-enough/README.md:
--------------------------------------------------------------------------------
1 | Close-Enough - A QUnit Addon For Number Approximations
2 | ================================
3 |
4 | This addon for QUnit adds close and notClose assertion methods, to test that
5 | numbers are close enough (or different enough) from an expected number, with
6 | a specified accuracy.
7 |
8 | Usage:
9 |
10 | close(actual, expected, maxDifference, message)
11 | notClose(actual, expected, minDifference, message)
12 |
13 | Where:
14 |
15 | * maxDifference: the maximum inclusive difference allowed between the actual and expected numbers
16 | * minDifference: the minimum exclusive difference allowed between the actual and expected numbers
17 | * actual, expected, message: The usual
18 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/close-enough/close-enough-test.js:
--------------------------------------------------------------------------------
1 | test("Close Numbers", function () {
2 |
3 | QUnit.close(7, 7, 0);
4 | QUnit.close(7, 7.1, 0.1);
5 | QUnit.close(7, 7.1, 0.2);
6 |
7 | QUnit.close(3.141, Math.PI, 0.001);
8 | QUnit.close(3.1, Math.PI, 0.1);
9 |
10 | var halfPi = Math.PI / 2;
11 | QUnit.close(halfPi, 1.57, 0.001);
12 |
13 | var sqrt2 = Math.sqrt(2);
14 | QUnit.close(sqrt2, 1.4142, 0.0001);
15 |
16 | QUnit.close(Infinity, Infinity, 1);
17 |
18 | });
19 |
20 | test("Distant Numbers", function () {
21 |
22 | QUnit.notClose(6, 7, 0);
23 | QUnit.notClose(7, 7.2, 0.1);
24 | QUnit.notClose(7, 7.2, 0.19999999999);
25 |
26 | QUnit.notClose(3.141, Math.PI, 0.0001);
27 | QUnit.notClose(3.1, Math.PI, 0.001);
28 |
29 | var halfPi = Math.PI / 2;
30 | QUnit.notClose(halfPi, 1.57, 0.0001);
31 |
32 | var sqrt2 = Math.sqrt(2);
33 | QUnit.notClose(sqrt2, 1.4142, 0.00001);
34 |
35 | QUnit.notClose(Infinity, -Infinity, 5);
36 |
37 | });
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/close-enough/close-enough.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | QUnit Test Suite - Close Enough Addon
6 |
7 |
8 |
9 |
10 |
11 |
12 |
QUnit Test Suite - Close Enough
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/close-enough/qunit-close-enough.js:
--------------------------------------------------------------------------------
1 | QUnit.extend( QUnit, {
2 | /**
3 | * Checks that the first two arguments are equal, or are numbers close enough to be considered equal
4 | * based on a specified maximum allowable difference.
5 | *
6 | * @example close(3.141, Math.PI, 0.001);
7 | *
8 | * @param Number actual
9 | * @param Number expected
10 | * @param Number maxDifference (the maximum inclusive difference allowed between the actual and expected numbers)
11 | * @param String message (optional)
12 | */
13 | close: function(actual, expected, maxDifference, message) {
14 | var passes = (actual === expected) || Math.abs(actual - expected) <= maxDifference;
15 | QUnit.push(passes, actual, expected, message);
16 | },
17 |
18 | /**
19 | * Checks that the first two arguments are numbers with differences greater than the specified
20 | * minimum difference.
21 | *
22 | * @example notClose(3.1, Math.PI, 0.001);
23 | *
24 | * @param Number actual
25 | * @param Number expected
26 | * @param Number minDifference (the minimum exclusive difference allowed between the actual and expected numbers)
27 | * @param String message (optional)
28 | */
29 | notClose: function(actual, expected, minDifference, message) {
30 | QUnit.push(Math.abs(actual - expected) > minDifference, actual, expected, message);
31 | }
32 | });
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/composite/README.md:
--------------------------------------------------------------------------------
1 | Composite - A QUnit Addon For Running Multiple Test Files
2 | ================================
3 |
4 | Composite is a QUnit addon that, when handed an array of files, will
5 | open each of those files inside of an iframe, run the tests and
6 | display the results as a single suite of QUnit tests.
7 |
8 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/composite/composite-demo-test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | QUnit SubsuiteRunner Test Suite
6 |
7 |
8 |
9 |
10 |
11 |
12 |
21 |
22 |
23 |
24 |
Composite is a QUnit addon that, when handed an array of
11 | files, will open each of those files inside of an iframe, run
12 | the tests and display the results as a single suite of QUnit
13 | tests.
14 |
Using Composite
15 |
To use Composite, setup a standard QUnit html page as you
16 | would with other QUnit tests. Remember to include composite.js
17 | and composite.css. Then, inside of either an external js file,
18 | or a script block call the only new method that Composite
19 | exposes, QUnit.testSuites().
QUnit.testSuites() is
20 | passed an array of test files to run as follows:
31 | Composite Test: A suite which tests the implementation of composite.
32 | Composite Demo: A suite which demoes how Compisite is bootstrapped and run.
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/composite/qunit-composite.css:
--------------------------------------------------------------------------------
1 | iframe.qunit-subsuite{
2 | position: fixed;
3 | bottom: 0;
4 | left: 0;
5 |
6 | margin: 0;
7 | padding: 0;
8 | border-width: 1px 0 0;
9 | height: 45%;
10 | width: 100%;
11 |
12 | background: #fff;
13 | }
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/composite/qunit-composite.js:
--------------------------------------------------------------------------------
1 | (function( QUnit ) {
2 |
3 | var subsuiteFrame;
4 |
5 | QUnit.extend( QUnit, {
6 | testSuites: function( suites ) {
7 | for ( var i = 0; i < suites.length; i++ ) {
8 | (function( suite ) {
9 | asyncTest( suite, function() {
10 | QUnit.runSuite( suite );
11 | });
12 | }( suites[i] ) );
13 | }
14 | QUnit.done = function() {
15 | subsuiteFrame.style.display = "none";
16 | };
17 | },
18 |
19 | testStart: function( data ) {
20 | // update the test status to show which test suite is running
21 | QUnit.id( "qunit-testresult" ).innerHTML = "Running " + data.name + "... ";
22 | },
23 |
24 | testDone: function() {
25 | var current = QUnit.id( this.config.current.id ),
26 | children = current.children;
27 |
28 | // undo the auto-expansion of failed tests
29 | for ( var i = 0; i < children.length; i++ ) {
30 | if ( children[i].nodeName === "OL" ) {
31 | children[i].style.display = "none";
32 | }
33 | }
34 | },
35 |
36 | runSuite: function( suite ) {
37 | var body = document.getElementsByTagName( "body" )[0],
38 | iframe = subsuiteFrame = document.createElement( "iframe" ),
39 | iframeWin;
40 |
41 | iframe.className = "qunit-subsuite";
42 | body.appendChild( iframe );
43 |
44 | function onIframeLoad() {
45 | var module, test,
46 | count = 0;
47 |
48 | QUnit.extend( iframeWin.QUnit, {
49 | moduleStart: function( data ) {
50 | // capture module name for messages
51 | module = data.name;
52 | },
53 |
54 | testStart: function( data ) {
55 | // capture test name for messages
56 | test = data.name;
57 | },
58 |
59 | log: function( data ) {
60 | // pass all test details through to the main page
61 | var message = module + ": " + test + ": " + data.message;
62 | expect( ++count );
63 | QUnit.push( data.result, data.actual, data.expected, message );
64 | },
65 |
66 | done: function() {
67 | // start the wrapper test from the main page
68 | start();
69 | }
70 | });
71 | }
72 | QUnit.addEvent( iframe, "load", onIframeLoad );
73 |
74 | iframeWin = iframe.contentWindow;
75 | iframe.setAttribute( "src", suite );
76 |
77 | this.runSuite = function( suite ) {
78 | iframe.setAttribute( "src", suite );
79 | };
80 | }
81 | });
82 | }( QUnit ) );
83 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/step/README.md:
--------------------------------------------------------------------------------
1 | QUnit.step() - A QUnit Addon For Testing execution in order
2 | ============================================================
3 |
4 | This addon for QUnit adds a step method that allows you to assert
5 | the proper sequence in which the code should execute.
6 |
7 | Example:
8 |
9 | test("example test", function () {
10 | function x() {
11 | QUnit.step(2, "function y should be called first");
12 | }
13 | function y() {
14 | QUnit.step(1);
15 | }
16 | y();
17 | x();
18 | });
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/step/qunit-step.js:
--------------------------------------------------------------------------------
1 | QUnit.extend( QUnit, {
2 |
3 | /**
4 | * Check the sequence/order
5 | *
6 | * @example step(1); setTimeout(function () { step(3); }, 100); step(2);
7 | * @param Number expected The excepted step within the test()
8 | * @param String message (optional)
9 | */
10 | step: function (expected, message) {
11 | this.config.current.step++; // increment internal step counter.
12 | if (typeof message == "undefined") {
13 | message = "step " + expected;
14 | }
15 | var actual = this.config.current.step;
16 | QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
17 | }
18 | });
19 |
20 | /**
21 | * Reset the step counter for every test()
22 | */
23 | QUnit.testStart(function () {
24 | this.config.current.step = 0;
25 | });
26 |
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/step/step-test.js:
--------------------------------------------------------------------------------
1 | module('Step Addon');
2 | test("step", 3, function () {
3 | QUnit.step(1, "step starts at 1");
4 | setTimeout(function () {
5 | start();
6 | QUnit.step(3);
7 | }, 100);
8 | QUnit.step(2, "before the setTimeout callback is run");
9 | stop();
10 | });
11 | test("step counter", 1, function () {
12 | QUnit.step(1, "each test has its own step counter");
13 | });
--------------------------------------------------------------------------------
/node_modules/qunit-tap/vendor/qunit/addons/step/step.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | QUnit Test Suite - Step Addon
6 |
7 |
8 |
9 |
10 |
11 |
12 |