Compare commits
1060 Commits
v1.1.0.rc3
...
v2.6.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2835ca3cce | ||
|
|
120c484419 | ||
|
|
1d62504534 | ||
|
|
055d88eff8 | ||
|
|
d2b33e0c66 | ||
|
|
0c7f36a181 | ||
|
|
686d8157e5 | ||
|
|
b771c083cb | ||
|
|
fbd2ffc08b | ||
|
|
b3c8fb9797 | ||
|
|
ef3cfe7f44 | ||
|
|
0d6ecbec17 | ||
|
|
7e4b8d4531 | ||
|
|
4b696fbf26 | ||
|
|
74511f5425 | ||
|
|
3e912f7f4e | ||
|
|
19b83a7434 | ||
|
|
98569ba0f3 | ||
|
|
7f11ecb62e | ||
|
|
97f8db0616 | ||
|
|
50880fcff7 | ||
|
|
ddcae84480 | ||
|
|
9d6a95d9ba | ||
|
|
0d3b2b2f8e | ||
|
|
08f046c24c | ||
|
|
90c87140ac | ||
|
|
25d9a396aa | ||
|
|
c42b1972e2 | ||
|
|
7f8f2b5e7a | ||
|
|
9cb2f06aa6 | ||
|
|
a37b6c0d32 | ||
|
|
5533d1a920 | ||
|
|
75e652d6a7 | ||
|
|
e1f7ca51da | ||
|
|
538ae7b9ac | ||
|
|
2ea41d3e27 | ||
|
|
bd9ae3a25b | ||
|
|
1042c9a2dd | ||
|
|
92e7436db2 | ||
|
|
74fe7fb85b | ||
|
|
7e0fd79b3b | ||
|
|
8807bbb850 | ||
|
|
c93f35fbc8 | ||
|
|
4cfdd06700 | ||
|
|
19b89d437e | ||
|
|
43f96d3ecd | ||
|
|
ac42bd9b35 | ||
|
|
9fbd0ba551 | ||
|
|
52876a7bf2 | ||
|
|
2eec3427e8 | ||
|
|
ed23254865 | ||
|
|
137e7e94d3 | ||
|
|
923b8fe9c4 | ||
|
|
61cc1eec66 | ||
|
|
04be4c4583 | ||
|
|
b59ac96b51 | ||
|
|
be6ff8b24c | ||
|
|
da2005fe97 | ||
|
|
41a813521b | ||
|
|
54e7a82ef3 | ||
|
|
d5e6bf47ed | ||
|
|
5a76e59d5b | ||
|
|
f5cfa2a4c1 | ||
|
|
c21bdaf35d | ||
|
|
369e8cc08b | ||
|
|
0e9b9a11c3 | ||
|
|
9750ae59e7 | ||
|
|
2f01f64249 | ||
|
|
17c89c69d6 | ||
|
|
d85d6dd4b8 | ||
|
|
ff85714b24 | ||
|
|
0d1a9a72d9 | ||
|
|
63cc6687ff | ||
|
|
75a5681c5e | ||
|
|
9df1edbdc9 | ||
|
|
5279e7a8c4 | ||
|
|
c2e2bd7c91 | ||
|
|
bad9c63bf7 | ||
|
|
05097b3e42 | ||
|
|
1efed4c156 | ||
|
|
f4849f6401 | ||
|
|
ec2ae4d521 | ||
|
|
ac3d64cf84 | ||
|
|
2d3c8c9f26 | ||
|
|
6816bc4252 | ||
|
|
04bb56a5b5 | ||
|
|
ed31b9b844 | ||
|
|
4e47b78f1f | ||
|
|
8e23c26383 | ||
|
|
56191cfb2e | ||
|
|
8624a52ee0 | ||
|
|
a4b92b34f4 | ||
|
|
3486e8d166 | ||
|
|
8366ef9be5 | ||
|
|
ab0567c665 | ||
|
|
8676bbf11a | ||
|
|
c0a9d20a02 | ||
|
|
c7cc3b4a29 | ||
|
|
5a2e1b0082 | ||
|
|
f196faf0bb | ||
|
|
850204dfb8 | ||
|
|
7bda3bd728 | ||
|
|
b9c25e88b9 | ||
|
|
13228c304e | ||
|
|
da18479422 | ||
|
|
ba211e4913 | ||
|
|
5f9a965d7c | ||
|
|
3ff59835ea | ||
|
|
9fedf74f32 | ||
|
|
0339fc500a | ||
|
|
227b0c62a3 | ||
|
|
3de60067f0 | ||
|
|
cb1001e6c2 | ||
|
|
d9ded15c45 | ||
|
|
a0bce8031e | ||
|
|
7f7dda7a2c | ||
|
|
15f92b226c | ||
|
|
99aa2247b6 | ||
|
|
314eb63552 | ||
|
|
bd6ca98f9d | ||
|
|
eee75d8eed | ||
|
|
5e0ebadb3d | ||
|
|
738c10fd43 | ||
|
|
8c9ffe3144 | ||
|
|
ab2c916c3a | ||
|
|
290fb3fdcd | ||
|
|
de7b7c029e | ||
|
|
e13c7a55a9 | ||
|
|
7a62969a14 | ||
|
|
604cd6132f | ||
|
|
2710bdfc5e | ||
|
|
f6da084642 | ||
|
|
6c0224414c | ||
|
|
c302545ba4 | ||
|
|
954a6a0091 | ||
|
|
11cfaae42a | ||
|
|
927cc011d6 | ||
|
|
6cf2d94f73 | ||
|
|
b578e72c8f | ||
|
|
1da6c7cf85 | ||
|
|
87e808282b | ||
|
|
14067d0785 | ||
|
|
d1a94bcf50 | ||
|
|
bbf3f6825c | ||
|
|
9b653b9dcb | ||
|
|
b6798cdb06 | ||
|
|
dbd198f7d0 | ||
|
|
5583b6f954 | ||
|
|
db8e636021 | ||
|
|
90dea9ab38 | ||
|
|
ebbefafc26 | ||
|
|
b66ffc1277 | ||
|
|
5458f2f18d | ||
|
|
602f5bc08a | ||
|
|
4e4cd30965 | ||
|
|
7224c6adf2 | ||
|
|
5bdd7e8fbf | ||
|
|
1e0381a495 | ||
|
|
c454658c54 | ||
|
|
b7d8b0de71 | ||
|
|
342f0eb9a3 | ||
|
|
44b56093e7 | ||
|
|
bee8132848 | ||
|
|
e5c744f3dc | ||
|
|
4fb5aa14b8 | ||
|
|
43cd73938d | ||
|
|
f38e8e9235 | ||
|
|
fcd5a1948b | ||
|
|
6489b0f400 | ||
|
|
5e3582d8e7 | ||
|
|
33151ed9eb | ||
|
|
3f27ff1c7c | ||
|
|
b59cacf131 | ||
|
|
d6f1f8dec5 | ||
|
|
e0541eca80 | ||
|
|
8b7cb21874 | ||
|
|
ee0ff3b6c8 | ||
|
|
65241565c5 | ||
|
|
a047115eef | ||
|
|
0d4c8d13bb | ||
|
|
17c5e2b10d | ||
|
|
fa71928cad | ||
|
|
3e91ac0889 | ||
|
|
79206ccff5 | ||
|
|
a95c2cfe3f | ||
|
|
e2e2d1b343 | ||
|
|
3b53e469fd | ||
|
|
c8b212f278 | ||
|
|
b3f69852c1 | ||
|
|
1613a376b1 | ||
|
|
1e35e8ba95 | ||
|
|
a6b209bc2f | ||
|
|
2301914549 | ||
|
|
320c42b6cc | ||
|
|
df45b4fede | ||
|
|
c1ab3c9cbe | ||
|
|
d2f2e2b870 | ||
|
|
0f6a7f04b3 | ||
|
|
728af5e556 | ||
|
|
018fd53c10 | ||
|
|
25d73515f3 | ||
|
|
8e317d4026 | ||
|
|
ea4c44904d | ||
|
|
77514bbb80 | ||
|
|
a85c3a4da8 | ||
|
|
0b1e1a0401 | ||
|
|
3374415add | ||
|
|
c2ae3b6b12 | ||
|
|
110cacab19 | ||
|
|
db7879a478 | ||
|
|
e7dbc75fc2 | ||
|
|
a81466d9e7 | ||
|
|
48f42eaa7d | ||
|
|
e5c2572753 | ||
|
|
141fd910f2 | ||
|
|
a93bfd2120 | ||
|
|
4221b2d2c4 | ||
|
|
6ee7fd6ced | ||
|
|
878325e2cf | ||
|
|
80c4f87dd5 | ||
|
|
3f3fa484b2 | ||
|
|
d0ad9b98cd | ||
|
|
375a6f9fda | ||
|
|
c017f0000d | ||
|
|
4097718b66 | ||
|
|
825dab32ff | ||
|
|
f3a7396845 | ||
|
|
850bee5492 | ||
|
|
6028a5d92c | ||
|
|
93a13ab791 | ||
|
|
542f483228 | ||
|
|
459b4c29b6 | ||
|
|
750a9aac6d | ||
|
|
cd55f03912 | ||
|
|
79954311fb | ||
|
|
3f71bcdb2d | ||
|
|
06f05ac57b | ||
|
|
5ea5ec6004 | ||
|
|
f7033f6551 | ||
|
|
7e6e905814 | ||
|
|
a6a1962924 | ||
|
|
50944fea6f | ||
|
|
7bfc4c0a45 | ||
|
|
4be2079482 | ||
|
|
d6f47ea886 | ||
|
|
5061dd066c | ||
|
|
2a847a67e3 | ||
|
|
50223d97d6 | ||
|
|
302e78f1df | ||
|
|
42ad12ec52 | ||
|
|
c41fa7d156 | ||
|
|
0b1449228f | ||
|
|
65a6decd6d | ||
|
|
7cbd86357d | ||
|
|
4f278be2c2 | ||
|
|
f2bc9b5bd8 | ||
|
|
e9d79bc946 | ||
|
|
0b2097b616 | ||
|
|
f02824ae52 | ||
|
|
225c7bdda3 | ||
|
|
e855c898d1 | ||
|
|
426eebe1ce | ||
|
|
add841a1e9 | ||
|
|
023c998660 | ||
|
|
3dde7d0c29 | ||
|
|
4e3f9a4d09 | ||
|
|
b89fbc71a7 | ||
|
|
4c0e3b2aed | ||
|
|
19f812c4f6 | ||
|
|
5ea24a8448 | ||
|
|
4173a4089c | ||
|
|
f712b795d7 | ||
|
|
ff029b37b5 | ||
|
|
7cd8c41d31 | ||
|
|
d7dd85c64f | ||
|
|
2d5c071d28 | ||
|
|
76bc0a87db | ||
|
|
5cae401c98 | ||
|
|
1d366772b7 | ||
|
|
d137b83c1c | ||
|
|
692c8716f0 | ||
|
|
965229bd03 | ||
|
|
46044dd345 | ||
|
|
2af9a45fb2 | ||
|
|
abc0c4a97e | ||
|
|
eb1d98338a | ||
|
|
f0c480f456 | ||
|
|
7693a4c959 | ||
|
|
1a08d1e8c6 | ||
|
|
ce9600a3f6 | ||
|
|
c58d83bbe3 | ||
|
|
1c6f4ef0e6 | ||
|
|
c77ff30263 | ||
|
|
dc652cfb05 | ||
|
|
22f58c0049 | ||
|
|
715de7aa38 | ||
|
|
0c68cc4afc | ||
|
|
ce6ce4e2c7 | ||
|
|
10f87b3b90 | ||
|
|
0776146d3b | ||
|
|
bbac4bb23f | ||
|
|
8c59875afe | ||
|
|
cdee9c8853 | ||
|
|
69956bf8f6 | ||
|
|
e1249ac89a | ||
|
|
a84e0cd8ef | ||
|
|
6177a4aeff | ||
|
|
471a241493 | ||
|
|
d5dfbc98c3 | ||
|
|
2ab2a83a3b | ||
|
|
f22862fd80 | ||
|
|
53b0752ff0 | ||
|
|
7616e5a3fd | ||
|
|
e173cd1c9d | ||
|
|
234dc1a047 | ||
|
|
d22a030b87 | ||
|
|
4acb7448d8 | ||
|
|
a26e85ff3a | ||
|
|
39e175c05f | ||
|
|
d129a6c0ee | ||
|
|
837101c025 | ||
|
|
8e3066db42 | ||
|
|
a857f4c042 | ||
|
|
dca543accb | ||
|
|
5dbcf27f72 | ||
|
|
b54de4a180 | ||
|
|
46509f05a9 | ||
|
|
ebaa2e7f24 | ||
|
|
5eaf7152bf | ||
|
|
ebbaab4cf9 | ||
|
|
1936a36c79 | ||
|
|
1dd4af3835 | ||
|
|
6ae054c3e2 | ||
|
|
e5feba994f | ||
|
|
20faa883fb | ||
|
|
3bba1eabd4 | ||
|
|
9ad3eac469 | ||
|
|
3140d5fb95 | ||
|
|
69a61547e7 | ||
|
|
a999490de9 | ||
|
|
c1479acd17 | ||
|
|
3a93f845d6 | ||
|
|
6c58024321 | ||
|
|
aeae141fd4 | ||
|
|
a951bbbb47 | ||
|
|
895c17e5c1 | ||
|
|
a84eaf2cbe | ||
|
|
9f240c5b9e | ||
|
|
dfa8a77dc3 | ||
|
|
2472982fe9 | ||
|
|
c85500a924 | ||
|
|
482f4d62fc | ||
|
|
bfcd8b046d | ||
|
|
2ab22951a1 | ||
|
|
6c131beda7 | ||
|
|
ea88023553 | ||
|
|
6bd98cb2ab | ||
|
|
b4b3ac25a1 | ||
|
|
7570bc422b | ||
|
|
eca8d8f009 | ||
|
|
305252f5a8 | ||
|
|
0fdb28c6ff | ||
|
|
a84202a6f9 | ||
|
|
503f4b7f49 | ||
|
|
fbe38018c9 | ||
|
|
8bb2f67fb3 | ||
|
|
ba9c863de9 | ||
|
|
02161b7d48 | ||
|
|
4d5f27d359 | ||
|
|
a4faa80be4 | ||
|
|
b68ba90ad7 | ||
|
|
dc7be9c55e | ||
|
|
b56c2a69ac | ||
|
|
4b6789ccd9 | ||
|
|
9f94e8e226 | ||
|
|
55f32e2dc6 | ||
|
|
b30a85c8f1 | ||
|
|
20ce62d5f5 | ||
|
|
c3de57aaac | ||
|
|
2517ddfe17 | ||
|
|
23a492cb65 | ||
|
|
25c546a904 | ||
|
|
97ab0cb403 | ||
|
|
42b1bda919 | ||
|
|
216b40439f | ||
|
|
590a9d9d41 | ||
|
|
66c8624022 | ||
|
|
75e5a5c308 | ||
|
|
9b5c20cc19 | ||
|
|
cc720e7f56 | ||
|
|
1426416666 | ||
|
|
197cb13817 | ||
|
|
816b7d701f | ||
|
|
da6813ef0d | ||
|
|
a4d134521a | ||
|
|
d4fc787ea7 | ||
|
|
663fbd0cdb | ||
|
|
cf83ae474c | ||
|
|
325c5a2288 | ||
|
|
3ca687a9ad | ||
|
|
3b557f85c7 | ||
|
|
b67a19507f | ||
|
|
ecae3d47a7 | ||
|
|
a76d6d1cd4 | ||
|
|
916dc03d9c | ||
|
|
2151a13705 | ||
|
|
6cc09e00d3 | ||
|
|
6d6c31328b | ||
|
|
c8cd2eabe5 | ||
|
|
f77071254a | ||
|
|
8880729250 | ||
|
|
9ad15eeaba | ||
|
|
10ca5f0246 | ||
|
|
a5cd2731b4 | ||
|
|
b12974db2e | ||
|
|
f4e5573ee3 | ||
|
|
0c77c6cfb5 | ||
|
|
cfc64a6f5c | ||
|
|
6ab70923b3 | ||
|
|
d9c0b10be4 | ||
|
|
a58fd20d82 | ||
|
|
eefa716530 | ||
|
|
66c364564e | ||
|
|
68ba5b6d48 | ||
|
|
15ae0379ec | ||
|
|
1fb0d2eefa | ||
|
|
ba0982d89f | ||
|
|
f703539942 | ||
|
|
62840f72a6 | ||
|
|
6d10f97151 | ||
|
|
15f3d0e9d7 | ||
|
|
b1344d5c73 | ||
|
|
59aaac026c | ||
|
|
21f62c697a | ||
|
|
dc93c33af6 | ||
|
|
4889583d5c | ||
|
|
41df058171 | ||
|
|
fa837ae90a | ||
|
|
c82c958e0d | ||
|
|
752e831b30 | ||
|
|
bd30065d66 | ||
|
|
84dff421ea | ||
|
|
709e032d1c | ||
|
|
1290d93b6a | ||
|
|
345903220c | ||
|
|
3332f93a24 | ||
|
|
3b19d66268 | ||
|
|
137c1a39f6 | ||
|
|
9402d59859 | ||
|
|
e8178d061b | ||
|
|
dd75394ea8 | ||
|
|
6b857d11ce | ||
|
|
eb48c83649 | ||
|
|
08a35d134d | ||
|
|
14824b5f9e | ||
|
|
9afae3d978 | ||
|
|
64a67ed320 | ||
|
|
dee1066652 | ||
|
|
d7ab9083be | ||
|
|
caee1508d1 | ||
|
|
3b8326f1e6 | ||
|
|
980509cd7b | ||
|
|
b984ff2fa6 | ||
|
|
61bf9ac7d7 | ||
|
|
5b397ff33e | ||
|
|
cd4d5c2445 | ||
|
|
5b6edff3fd | ||
|
|
cc3678f033 | ||
|
|
35f52bcb24 | ||
|
|
f8bccabf03 | ||
|
|
97867b2bf5 | ||
|
|
18eb6e2f36 | ||
|
|
51462f369b | ||
|
|
ea57ad97cf | ||
|
|
3132d98f23 | ||
|
|
b799f54bc9 | ||
|
|
ac8ef2988d | ||
|
|
3c051fc291 | ||
|
|
6b937da863 | ||
|
|
89232db2ee | ||
|
|
8b0d9c83bb | ||
|
|
60533ca868 | ||
|
|
048ab728ec | ||
|
|
488df899fb | ||
|
|
753f4b44b4 | ||
|
|
2c23d35b03 | ||
|
|
2b0be0c74b | ||
|
|
b4f49db6bd | ||
|
|
cee3cc56e6 | ||
|
|
f2346d357f | ||
|
|
ee09301d8d | ||
|
|
760b50d969 | ||
|
|
773b15e450 | ||
|
|
227698f5fa | ||
|
|
ff1fa6a893 | ||
|
|
ba1f8bc036 | ||
|
|
a5be51f912 | ||
|
|
d64ed6ebe9 | ||
|
|
062dc6b15a | ||
|
|
33641578e6 | ||
|
|
a1c109ea17 | ||
|
|
62212bbfa4 | ||
|
|
6a89d084f4 | ||
|
|
013c4f725f | ||
|
|
c064488192 | ||
|
|
f20df57607 | ||
|
|
48f7a5f17b | ||
|
|
f7ff47706c | ||
|
|
5f34be446c | ||
|
|
e1e49e8292 | ||
|
|
ae94dd1bfa | ||
|
|
eb1bd25445 | ||
|
|
aac6968ed8 | ||
|
|
1bad048c15 | ||
|
|
7d93541c09 | ||
|
|
29aad761d9 | ||
|
|
7d3de92cef | ||
|
|
13e0dd27c9 | ||
|
|
f0892a55aa | ||
|
|
fc6603e99f | ||
|
|
07cce0b1d1 | ||
|
|
6750559211 | ||
|
|
0419780682 | ||
|
|
6066c71966 | ||
|
|
0d4b04d37c | ||
|
|
7ad261837a | ||
|
|
00c8e37257 | ||
|
|
e53b487017 | ||
|
|
ed5cd6ba2c | ||
|
|
213a6023fd | ||
|
|
7d220fcd1b | ||
|
|
c1382c77b4 | ||
|
|
311263a3df | ||
|
|
33e4f5efbe | ||
|
|
367d3dcf66 | ||
|
|
21de44a204 | ||
|
|
c9e37a2a1c | ||
|
|
9e927af56e | ||
|
|
fc173e9a5e | ||
|
|
62a7f64659 | ||
|
|
3e739e4bc9 | ||
|
|
ba6f99423f | ||
|
|
3a5672cd33 | ||
|
|
af4cc76e2a | ||
|
|
1922514f2d | ||
|
|
668846147c | ||
|
|
76fafa0388 | ||
|
|
bed1c15ea4 | ||
|
|
6caf4c5de2 | ||
|
|
97ae9a2d88 | ||
|
|
71dbffeaef | ||
|
|
a3c3505086 | ||
|
|
a9e0112a9b | ||
|
|
a2ac5ef3b6 | ||
|
|
b200952195 | ||
|
|
9c6d03d3ac | ||
|
|
752a36d3ff | ||
|
|
52026fb0f7 | ||
|
|
e17a2cb1e0 | ||
|
|
ec5695acc1 | ||
|
|
47884032ad | ||
|
|
d7053612f5 | ||
|
|
9d1e92f5e2 | ||
|
|
eebba2ecca | ||
|
|
627a262085 | ||
|
|
305bd73142 | ||
|
|
fb853ad5b5 | ||
|
|
640f94a1bd | ||
|
|
5aac3e3292 | ||
|
|
84160ff51d | ||
|
|
e972bac80d | ||
|
|
455b6bade8 | ||
|
|
23c0e379e0 | ||
|
|
31d71ac22f | ||
|
|
095b02ad83 | ||
|
|
98c258a659 | ||
|
|
85fa148f18 | ||
|
|
76ca5ef6d4 | ||
|
|
46d2c43da1 | ||
|
|
b6c03a34e7 | ||
|
|
4ddf316388 | ||
|
|
a8cbef3123 | ||
|
|
a937d8d74f | ||
|
|
2fc2802809 | ||
|
|
7cf899a4ea | ||
|
|
83c0ea7f91 | ||
|
|
289c8313d1 | ||
|
|
b5775aec4f | ||
|
|
21b01f4a5d | ||
|
|
71faeea7b0 | ||
|
|
de7d005b3d | ||
|
|
7acf5d4220 | ||
|
|
2a8b5a30b6 | ||
|
|
9c7ba43ebd | ||
|
|
8ca08ff999 | ||
|
|
15aa3ecb5d | ||
|
|
2670bb40a7 | ||
|
|
c8ffa6000b | ||
|
|
06a553503d | ||
|
|
aab4808410 | ||
|
|
b525313cdb | ||
|
|
f576395620 | ||
|
|
b161e9e3df | ||
|
|
94ecb998bb | ||
|
|
38daa43c7e | ||
|
|
9fb9c12066 | ||
|
|
de2fb225b0 | ||
|
|
4f4ae086aa | ||
|
|
8510bdd947 | ||
|
|
66bd8c7825 | ||
|
|
a736e664ea | ||
|
|
812b14d000 | ||
|
|
a2a8b5dde2 | ||
|
|
78bed99ba3 | ||
|
|
b1d4ab09af | ||
|
|
3b52d015ea | ||
|
|
f9191d7b0d | ||
|
|
83a692d5a8 | ||
|
|
14a8c2ca09 | ||
|
|
b2e8de7bcd | ||
|
|
1d98a23b14 | ||
|
|
16ffd3b3fb | ||
|
|
6bc87ad223 | ||
|
|
555d328cf2 | ||
|
|
c78fba4b13 | ||
|
|
8a6d7828c6 | ||
|
|
c888b0c1b8 | ||
|
|
72e9851217 | ||
|
|
7ee5073921 | ||
|
|
614a18453e | ||
|
|
916f889c01 | ||
|
|
4a7b79ad0d | ||
|
|
775e2ff0a9 | ||
|
|
1b6725ec25 | ||
|
|
952eb59707 | ||
|
|
de6a305b44 | ||
|
|
8513201fa3 | ||
|
|
6e07dccb68 | ||
|
|
fcc50cc6f4 | ||
|
|
9e8466ba2b | ||
|
|
4350045d61 | ||
|
|
666e9c341e | ||
|
|
5830d9f86b | ||
|
|
ea888e4c03 | ||
|
|
c7e3ca6c8a | ||
|
|
06db4a8583 | ||
|
|
a2debf60b6 | ||
|
|
04c7db9259 | ||
|
|
8585ef69a5 | ||
|
|
cb5aea1fcf | ||
|
|
966f76b481 | ||
|
|
40e3020fdc | ||
|
|
69549a6ff3 | ||
|
|
a03fad8911 | ||
|
|
61993cf1fc | ||
|
|
cd9d5284cd | ||
|
|
e346e7dcc1 | ||
|
|
dd8a455f91 | ||
|
|
9e149d1e0f | ||
|
|
797984f173 | ||
|
|
29c5c127e5 | ||
|
|
26581b4c91 | ||
|
|
3186b24a66 | ||
|
|
81b822fea9 | ||
|
|
fb8bede8ea | ||
|
|
243ff80196 | ||
|
|
284bb0b608 | ||
|
|
6453ed656b | ||
|
|
a1a948b8df | ||
|
|
7a4876ecfa | ||
|
|
d9ece1f14f | ||
|
|
f1613ce77c | ||
|
|
a3424ea265 | ||
|
|
ab0b2b783c | ||
|
|
d0aff9ed02 | ||
|
|
a309117758 | ||
|
|
0c6e590a93 | ||
|
|
d06da150de | ||
|
|
39d7ebf28e | ||
|
|
5f429fcb37 | ||
|
|
b6eb9a4d5e | ||
|
|
fdb7df812c | ||
|
|
81299860aa | ||
|
|
ca6fa6f711 | ||
|
|
5aaafed4d8 | ||
|
|
c28c124f58 | ||
|
|
f0a1adb61c | ||
|
|
5ff2aecab8 | ||
|
|
8ca8197b4c | ||
|
|
55716723b5 | ||
|
|
3973cc5a71 | ||
|
|
95af58ade6 | ||
|
|
6641d64305 | ||
|
|
7c1fcd7bb5 | ||
|
|
e91d0341a4 | ||
|
|
144ff174f6 | ||
|
|
af4bfa8bc4 | ||
|
|
620e3f5992 | ||
|
|
ea76a30d85 | ||
|
|
adde1b4a5b | ||
|
|
07e7ad2314 | ||
|
|
b5b77b318a | ||
|
|
706180ad01 | ||
|
|
547c9cfde9 | ||
|
|
d3ec12e62a | ||
|
|
749c15fe07 | ||
|
|
7e071547f5 | ||
|
|
6354ee17e5 | ||
|
|
255a50baee | ||
|
|
520a8c85a2 | ||
|
|
6de355544f | ||
|
|
95572fb314 | ||
|
|
18e1ab93ea | ||
|
|
0c4113e167 | ||
|
|
a563e67015 | ||
|
|
fab489851e | ||
|
|
1c19b8e38a | ||
|
|
fc258b3d36 | ||
|
|
ffa6138d75 | ||
|
|
51dd66a4cc | ||
|
|
37a3135d6a | ||
|
|
cb8ba74937 | ||
|
|
70fb0f0ed5 | ||
|
|
15889494c5 | ||
|
|
da33c7823e | ||
|
|
04e1d8420e | ||
|
|
19b2472761 | ||
|
|
1fc614ad19 | ||
|
|
84692f545c | ||
|
|
5017d1a4f1 | ||
|
|
963cd5e850 | ||
|
|
527394068e | ||
|
|
5e279a1393 | ||
|
|
8f0f0a607e | ||
|
|
4891d578e3 | ||
|
|
efc384c6d6 | ||
|
|
d60786a06c | ||
|
|
66010d01ec | ||
|
|
1619067ddd | ||
|
|
79a75f5bdb | ||
|
|
7158e048a6 | ||
|
|
f8f064d12d | ||
|
|
8ac085c103 | ||
|
|
03dfea967c | ||
|
|
f463e1f7aa | ||
|
|
4bff199c2a | ||
|
|
e3f0389ac2 | ||
|
|
be0f7b4117 | ||
|
|
edb46a6f7c | ||
|
|
a442acb8aa | ||
|
|
fc409f39a1 | ||
|
|
ba55cb5e38 | ||
|
|
2d4f398dd6 | ||
|
|
5ba6e51e1c | ||
|
|
ba43e37356 | ||
|
|
0f42f2709a | ||
|
|
4c4317b80e | ||
|
|
b4bb99dfdf | ||
|
|
d721418490 | ||
|
|
45fd8df861 | ||
|
|
0e800ee243 | ||
|
|
8a8cc03dea | ||
|
|
be0e6222c5 | ||
|
|
8c696ffc71 | ||
|
|
3dda67fe60 | ||
|
|
66d9b3d690 | ||
|
|
c350694c1b | ||
|
|
25d674f2c5 | ||
|
|
35bc200e31 | ||
|
|
9e886b3972 | ||
|
|
edd7e3932b | ||
|
|
0420e295f4 | ||
|
|
8d295a2612 | ||
|
|
d10b93cd28 | ||
|
|
358b9424b5 | ||
|
|
2571a6fbbb | ||
|
|
00f88edc04 | ||
|
|
98fa58ee49 | ||
|
|
984074ec95 | ||
|
|
6bb8a91301 | ||
|
|
97ce396008 | ||
|
|
051f3499ec | ||
|
|
8f5d0beb8c | ||
|
|
9609aba25f | ||
|
|
30aec66ce5 | ||
|
|
663a58d617 | ||
|
|
3847557bbc | ||
|
|
18c30566bd | ||
|
|
f2306729cd | ||
|
|
2165d71dc5 | ||
|
|
8c1881053c | ||
|
|
61a1f93488 | ||
|
|
d4f78922cd | ||
|
|
04ac41d911 | ||
|
|
75b9dc64af | ||
|
|
2d7fe0b6ce | ||
|
|
44feee57ac | ||
|
|
1394899c3c | ||
|
|
d0825a37a3 | ||
|
|
fc3d08bf40 | ||
|
|
990cc41f45 | ||
|
|
03ffe5ce6a | ||
|
|
1b0b4f22a0 | ||
|
|
a6953df28c | ||
|
|
5e71f3031e | ||
|
|
4ea4ed25ee | ||
|
|
39d40a1cad | ||
|
|
d40e0cebac | ||
|
|
89a54ea2bb | ||
|
|
bc9c857f43 | ||
|
|
24a7f55fa6 | ||
|
|
182cff4bd4 | ||
|
|
5dce5b1272 | ||
|
|
7c17b06856 | ||
|
|
6569176cc9 | ||
|
|
0f803430e4 | ||
|
|
821f13dff5 | ||
|
|
3e2d9baec2 | ||
|
|
f637c1f833 | ||
|
|
82b6904093 | ||
|
|
0daae4d7b4 | ||
|
|
f68657f14e | ||
|
|
c91df21a96 | ||
|
|
5b986c953c | ||
|
|
a932320d6c | ||
|
|
aabf8cec82 | ||
|
|
ccdcb293f4 | ||
|
|
ec7d58fce0 | ||
|
|
7f6b16ccf2 | ||
|
|
34b8bf5fb0 | ||
|
|
179e54b9fb | ||
|
|
09fe7b0540 | ||
|
|
264b1fea50 | ||
|
|
dcf7a0867e | ||
|
|
f5bc9faf63 | ||
|
|
2916a8a1ff | ||
|
|
8ac33ff6c2 | ||
|
|
661a884416 | ||
|
|
7acc6b327a | ||
|
|
e40e0c9170 | ||
|
|
7ae3fa9fef | ||
|
|
e73b9e7902 | ||
|
|
ffdf1eb16d | ||
|
|
d5f1264416 | ||
|
|
579fddc2d2 | ||
|
|
313e607135 | ||
|
|
b6599d52aa | ||
|
|
582ad6512a | ||
|
|
600be098af | ||
|
|
b87eb240b3 | ||
|
|
7055d95584 | ||
|
|
1c87060804 | ||
|
|
b4acdbd90a | ||
|
|
fbb9f53524 | ||
|
|
0ac497db6b | ||
|
|
9e31201f1a | ||
|
|
d53002c63a | ||
|
|
3271dc8838 | ||
|
|
475aacbfbb | ||
|
|
8303c79f26 | ||
|
|
5700ace2c9 | ||
|
|
aca43bd3a3 | ||
|
|
7516bba2b0 | ||
|
|
4f19d34ad7 | ||
|
|
c40b64a24c | ||
|
|
baad5ff01f | ||
|
|
bf2adf55eb | ||
|
|
dd8d3f9788 | ||
|
|
9c4467bac0 | ||
|
|
c017257164 | ||
|
|
2445fb36dc | ||
|
|
eec6d7d23e | ||
|
|
3110da62e5 | ||
|
|
d41b281eb1 | ||
|
|
6feb124853 | ||
|
|
3be247ceb1 | ||
|
|
edc2bfae93 | ||
|
|
01b2fc612c | ||
|
|
d8f6aac2cd | ||
|
|
e7a930a5b3 | ||
|
|
6b2d8da55f | ||
|
|
538b32e401 | ||
|
|
e6e8908f49 | ||
|
|
86dafd5d2d | ||
|
|
aa60d5f00d | ||
|
|
079e6e1e08 | ||
|
|
7706512525 | ||
|
|
e09fd40933 | ||
|
|
6eecc562ff | ||
|
|
cf7bb0269b | ||
|
|
b22bf9a031 | ||
|
|
b7af6abca5 | ||
|
|
d6da13a8dd | ||
|
|
dc4563d45c | ||
|
|
92492c0144 | ||
|
|
d6987a6c84 | ||
|
|
43c8fdd33f | ||
|
|
98ae076f0c | ||
|
|
2c06e36b9b | ||
|
|
5a744884fe | ||
|
|
e6888b840d | ||
|
|
e682d18387 | ||
|
|
10b09ea9f5 | ||
|
|
c53b36a9b2 | ||
|
|
af71f4d2f9 | ||
|
|
83227f2163 | ||
|
|
f865758124 | ||
|
|
3fc79bac9e | ||
|
|
05977203a6 | ||
|
|
5bea864e1c | ||
|
|
a9eaa66da5 | ||
|
|
30bf565e69 | ||
|
|
668dd784ef | ||
|
|
4ad43267ab | ||
|
|
be6b87a31b | ||
|
|
43552494ee | ||
|
|
98c99c4ebb | ||
|
|
4318de4647 | ||
|
|
a526ebf261 | ||
|
|
c2e1327f39 | ||
|
|
234f2a1585 | ||
|
|
c584f182ab | ||
|
|
74f928fd54 | ||
|
|
a1011e7748 | ||
|
|
8b02bf731b | ||
|
|
779dee1211 | ||
|
|
1f5e790c41 | ||
|
|
cd3a0c854b | ||
|
|
f9cbad1512 | ||
|
|
f840458b34 | ||
|
|
34bd1969e7 | ||
|
|
dfed37531e | ||
|
|
08f5a8c98f | ||
|
|
8d94d0bfc5 | ||
|
|
3e5da57cf9 | ||
|
|
e2af08e0a6 | ||
|
|
b6c3999c3a | ||
|
|
6785d1a05c | ||
|
|
e74f09df9c | ||
|
|
f7c9aaa996 | ||
|
|
86994b25db | ||
|
|
9a7c76ea23 | ||
|
|
e3a013ae99 | ||
|
|
ead9aa6d5a | ||
|
|
d9467317a8 | ||
|
|
63ad879c12 | ||
|
|
b95c43ab7c | ||
|
|
3685d3199c | ||
|
|
a34077a8af | ||
|
|
ac55e26870 | ||
|
|
acdc497361 | ||
|
|
b527ccd2fa | ||
|
|
cfa95fcf2c | ||
|
|
ae9ddd74a2 | ||
|
|
26f0f6f213 | ||
|
|
c5ba032d28 | ||
|
|
bbc4c70c91 | ||
|
|
c5c57247f8 | ||
|
|
9990eb7b6e | ||
|
|
b5b50182b2 | ||
|
|
4d106c2b33 | ||
|
|
5e594946bb | ||
|
|
6ac4b686a3 | ||
|
|
fd91433792 | ||
|
|
1f9004eaa3 | ||
|
|
58e6747930 | ||
|
|
4c083856be | ||
|
|
b94522193c | ||
|
|
867de62699 | ||
|
|
74cdc5a04f | ||
|
|
ddbee65aa8 | ||
|
|
beeb872a82 | ||
|
|
dbcb0b7983 | ||
|
|
c8436d1d44 | ||
|
|
639f757f6f | ||
|
|
d65bdc7e59 | ||
|
|
a1ed56741b | ||
|
|
7473b455dc | ||
|
|
b6fb23b069 | ||
|
|
386e83b53f | ||
|
|
f2b25f1780 | ||
|
|
5ca2888301 | ||
|
|
147cb36760 | ||
|
|
107463ad57 | ||
|
|
39a55d8f10 | ||
|
|
4b48dc1069 | ||
|
|
921f52862f | ||
|
|
ea2ffb7b01 | ||
|
|
54fbc48eb2 | ||
|
|
06c900ab20 | ||
|
|
3e070e9db6 | ||
|
|
7e04571ec0 | ||
|
|
ddd48f2c88 | ||
|
|
1c2e50d244 | ||
|
|
d2d60a798d | ||
|
|
442f3bf872 | ||
|
|
f910df00bb | ||
|
|
500b856cfa | ||
|
|
dad4865fbf | ||
|
|
1771ec3c63 | ||
|
|
2385acedd8 | ||
|
|
4c28bef387 | ||
|
|
7bbcf51d45 | ||
|
|
b6f96bc121 | ||
|
|
feebfbba68 | ||
|
|
8e4bd86865 | ||
|
|
4f218f7d6a | ||
|
|
bb1a4428db | ||
|
|
079740ca2c | ||
|
|
fbbccf6ef7 | ||
|
|
7ad75c13d4 | ||
|
|
d46ca4f506 | ||
|
|
ee7af4496c | ||
|
|
e22c4492a5 | ||
|
|
d63836afb4 | ||
|
|
06f1edc197 | ||
|
|
3a6b233a2e | ||
|
|
d15964b7dc | ||
|
|
6e22754c10 | ||
|
|
bab4538404 | ||
|
|
06d191af74 | ||
|
|
ad78d0d0d8 | ||
|
|
733a6a4ae4 | ||
|
|
3e0cad41f5 | ||
|
|
885832e920 | ||
|
|
3a0ada034b | ||
|
|
674197aef8 | ||
|
|
626da5a112 | ||
|
|
a3ccd8b0d3 | ||
|
|
4a1a2123a3 | ||
|
|
c87cf71f4f | ||
|
|
e4c557faae | ||
|
|
6559c5b43a | ||
|
|
912397120b | ||
|
|
551464b8d2 | ||
|
|
8a298e5c0e | ||
|
|
94a153ed15 | ||
|
|
b4439f74d5 | ||
|
|
d70e733f70 | ||
|
|
ac096f9911 | ||
|
|
08d72926ff | ||
|
|
67ec0af254 | ||
|
|
4f2fcff15a | ||
|
|
7158fc2426 | ||
|
|
992367dcbc | ||
|
|
ce886e20e4 | ||
|
|
86b0c80cc9 | ||
|
|
7dff84b1dc | ||
|
|
8c22b26d9c | ||
|
|
ad4f48dcd4 | ||
|
|
de9e2abad5 | ||
|
|
41f496001f | ||
|
|
6b5956724b | ||
|
|
ec24992250 | ||
|
|
83f232237d | ||
|
|
98d32bb4a4 | ||
|
|
c4f27ae377 | ||
|
|
dbcabd397e | ||
|
|
a8b0a0ee4f | ||
|
|
60a5d60f42 |
16
.codeclimate.yml
Normal file
16
.codeclimate.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
languages:
|
||||
JavaScript: true
|
||||
ratings:
|
||||
paths:
|
||||
- "src/**/*.js"
|
||||
exclude_paths:
|
||||
- "lib/**"
|
||||
- "dist/*"
|
||||
- "grunt/**"
|
||||
- "images/*"
|
||||
- "**/*.md"
|
||||
- "**/*.yml"
|
||||
- "**/*.json"
|
||||
- "**/*.scss"
|
||||
- "**/*.erb"
|
||||
- "*.sh"
|
||||
16
.editorconfig
Normal file
16
.editorconfig
Normal file
@@ -0,0 +1,16 @@
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{js, json, sh, yml, gemspec}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[{Rakefile, .jshintrc}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{py}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
139
.github/CONTRIBUTING.md
vendored
Normal file
139
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
# Developing for Jasmine Core
|
||||
|
||||
We welcome your contributions! Thanks for helping make Jasmine a better project for everyone. Please review the backlog and discussion lists before starting work. What you're looking for may already have been done. If it hasn't, the community can help make your contribution better. If you want to contribute but don't know what to work on, [issues tagged ready for work](https://github.com/jasmine/jasmine/labels/ready%20for%20work) should have enough detail to get started.
|
||||
|
||||
## Links
|
||||
|
||||
- [Jasmine Google Group](http://groups.google.com/group/jasmine-js)
|
||||
- [Jasmine-dev Google Group](http://groups.google.com/group/jasmine-js-dev)
|
||||
- [Jasmine on PivotalTracker](https://www.pivotaltracker.com/n/projects/10606)
|
||||
|
||||
## General Workflow
|
||||
|
||||
Please submit pull requests via feature branches using the semi-standard workflow of:
|
||||
|
||||
```bash
|
||||
git clone git@github.com:yourUserName/jasmine.git # Clone your fork
|
||||
cd jasmine # Change directory
|
||||
git remote add upstream https://github.com/jasmine/jasmine.git # Assign original repository to a remote named 'upstream'
|
||||
git fetch upstream # Pull in changes not present in your local repository
|
||||
git checkout -b my-new-feature # Create your feature branch
|
||||
git commit -am 'Add some feature' # Commit your changes
|
||||
git push origin my-new-feature # Push to the branch
|
||||
```
|
||||
|
||||
Once you've pushed a feature branch to your forked repo, you're ready to open a pull request. We favor pull requests with very small, single commits with a single purpose.
|
||||
|
||||
## Background
|
||||
|
||||
### Directory Structure
|
||||
|
||||
* `/src` contains all of the source files
|
||||
* `/src/console` - Node.js-specific files
|
||||
* `/src/core` - generic source files
|
||||
* `/src/html` - browser-specific files
|
||||
* `/spec` contains all of the tests
|
||||
* mirrors the source directory
|
||||
* there are some additional files
|
||||
* `/dist` contains the standalone distributions as zip files
|
||||
* `/lib` contains the generated files for distribution as the Jasmine Rubygem and the Python package
|
||||
|
||||
### Self-testing
|
||||
|
||||
Note that Jasmine tests itself. The files in `lib` are loaded first, defining the reference `jasmine`. Then the files in `src` are loaded, defining the reference `j$`. So there are two copies of the code loaded under test.
|
||||
|
||||
The tests should always use `j$` to refer to the objects and functions that are being tested. But the tests can use functions on `jasmine` as needed. _Be careful how you structure any new test code_. Copy the patterns you see in the existing code - this ensures that the code you're testing is not leaking into the `jasmine` reference and vice-versa.
|
||||
|
||||
### `boot.js`
|
||||
|
||||
__This is new for Jasmine 2.0.__
|
||||
|
||||
This file does all of the setup necessary for Jasmine to work. It loads all of the code, creates an `Env`, attaches the global functions, and builds the reporter. It also sets up the execution of the `Env` - for browsers this is in `window.onload`. While the default in `lib` is appropriate for browsers, projects may wish to customize this file.
|
||||
|
||||
For example, for Jasmine development there is a different `dev_boot.js` for Jasmine development that does more work.
|
||||
|
||||
### Compatibility
|
||||
|
||||
* Browser Minimum
|
||||
* IE8
|
||||
* Firefox 3.x
|
||||
* Chrome ??
|
||||
* Safari 5
|
||||
|
||||
## Development
|
||||
|
||||
All source code belongs in `src/`. The `core/` directory contains the bulk of Jasmine's functionality. This code should remain browser- and environment-agnostic. If your feature or fix cannot be, as mentioned above, please degrade gracefully. Any code that should only be in a non-browser environment should live in `src/console/`. Any code that depends on a browser (specifically, it expects `window` to be the global or `document` is present) should live in `src/html/`.
|
||||
|
||||
### Install Dependencies
|
||||
|
||||
Jasmine Core relies on Ruby and Node.js.
|
||||
|
||||
To install the Ruby dependencies, you will need Ruby, Rubygems, and Bundler available. Then:
|
||||
|
||||
$ bundle
|
||||
|
||||
...will install all of the Ruby dependencies. If the ffi gem fails to build its native extensions, you may need to manually install some system dependencies. On Ubuntu:
|
||||
|
||||
$ apt-get install gcc ruby ruby-dev libxml2 libxml2-dev libxslt1-dev
|
||||
|
||||
...should get you to the point that `bundle` can install everything.
|
||||
|
||||
To install the Node dependencies, you will need Node.js, Npm, and [Grunt](http://gruntjs.com/), the [grunt-cli](https://github.com/gruntjs/grunt-cli) and ensure that `grunt` is on your path.
|
||||
|
||||
$ npm install --local
|
||||
|
||||
...will install all of the node modules locally. Now run
|
||||
|
||||
$ grunt
|
||||
|
||||
...if you see that JSHint runs, your system is ready.
|
||||
|
||||
### How to write new Jasmine code
|
||||
|
||||
Or, How to make a successful pull request
|
||||
|
||||
* _Do not change the public interface_. Lots of projects depend on Jasmine and if you aren't careful you'll break them
|
||||
* _Be environment agnostic_ - server-side developers are just as important as browser developers
|
||||
* _Be browser agnostic_ - if you must rely on browser-specific functionality, please write it in a way that degrades gracefully
|
||||
* _Write specs_ - Jasmine's a testing framework; don't add functionality without test-driving it
|
||||
* _Write code in the style of the rest of the repo_ - Jasmine should look like a cohesive whole
|
||||
* _Ensure the *entire* test suite is green_ in all the big browsers, Node, and JSHint - your contribution shouldn't break Jasmine for other users
|
||||
|
||||
Follow these tips and your pull request, patch, or suggestion is much more likely to be integrated.
|
||||
|
||||
### Running Specs
|
||||
|
||||
Jasmine uses the [Jasmine Ruby gem](http://github.com/jasmine/jasmine-gem) to test itself in browser.
|
||||
|
||||
$ bundle exec rake jasmine
|
||||
|
||||
...and then visit `http://localhost:8888` to run specs.
|
||||
|
||||
Jasmine uses the [Jasmine NPM package](http://github.com/jasmine/jasmine-npm) to test itself in a Node.js/npm environment.
|
||||
|
||||
$ grunt execSpecsInNode
|
||||
|
||||
...and then the results will print to the console. All specs run except those that expect a browser (the specs in `spec/html` are ignored).
|
||||
|
||||
The easiest way to run the tests in **Internet Explorer** is to run a VM that has IE installed. It's easy to do this with VirtualBox.
|
||||
|
||||
1. Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
|
||||
1. Download a VM image [from Microsoft](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/). Select "VirtualBox" as the platform.
|
||||
1. Unzip the downloaded archive. There should be an OVA file inside.
|
||||
1. In VirtualBox, choose `File > Import Appliance` and select the OVA file. Accept the default settings in the dialog that appears. Now you have a Windows VM!
|
||||
1. Run the VM and start IE.
|
||||
1. With `bundle exec rake jasmine` running on your host machine, navigate to `http://10.0.2.2:8888` in IE.
|
||||
|
||||
## Before Committing or Submitting a Pull Request
|
||||
|
||||
1. Ensure all specs are green in browser *and* node
|
||||
1. Ensure JSHint is green with `grunt jshint`
|
||||
1. Build `jasmine.js` with `grunt buildDistribution` and run all specs again - this ensures that your changes self-test well
|
||||
|
||||
## Submitting a Pull Request
|
||||
1. Revert your changes to `jasmine.js` and `jasmine-html.js`
|
||||
* We do this because `jasmine.js` and `jasmine-html.js` are auto-generated (as you've seen in the previous steps) and accepting multiple pull requests when this auto-generated file changes causes lots of headaches
|
||||
1. When we accept your pull request, we will generate these files as a separate commit and merge the entire branch into master
|
||||
|
||||
Note that we use Travis for Continuous Integration. We only accept green pull requests.
|
||||
|
||||
17
.github/ISSUE_TEMPLATE.md
vendored
Normal file
17
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
### Are you creating an issue in the correct repository?
|
||||
|
||||
- When in doubt, create an issue here.
|
||||
- If you have an issue with the Jasmine docs, file an issue in the docs repo
|
||||
here: https://github.com/jasmine/jasmine.github.io
|
||||
- This repository is for the core Jasmine framework
|
||||
- If you are using a test runner that wraps Jasmine (Jasmine npm, karma, etc),
|
||||
consider filing an issue with that library if appropriate
|
||||
|
||||
### When submitting an issue, please answer the following:
|
||||
|
||||
- What version are you using?
|
||||
- What environment are you running Jasmine in (node, browser, etc)?
|
||||
- How are you running Jasmine (standalone, npm, karma, etc)?
|
||||
- If possible, include an example spec that demonstrates your issue.
|
||||
|
||||
Thanks for using Jasmine!
|
||||
13
.gitignore
vendored
13
.gitignore
vendored
@@ -5,8 +5,21 @@ site/
|
||||
.bundle/
|
||||
.pairs
|
||||
.rvmrc
|
||||
.ruby-gemset
|
||||
.ruby-version
|
||||
*.gem
|
||||
.bundle
|
||||
tags
|
||||
Gemfile.lock
|
||||
pkg/*
|
||||
.sass-cache/*
|
||||
src/html/.sass-cache/*
|
||||
node_modules/
|
||||
*.pyc
|
||||
sauce_connect.log
|
||||
*.swp
|
||||
build/
|
||||
*.egg-info/
|
||||
dist
|
||||
nbproject/
|
||||
*.iml
|
||||
|
||||
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
||||
[submodule "pages"]
|
||||
path = pages
|
||||
url = git@github.com:pivotal/jasmine.git
|
||||
url = https://github.com/pivotal/jasmine.git
|
||||
|
||||
9
.jshintrc
Normal file
9
.jshintrc
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"bitwise": true,
|
||||
"curly": true,
|
||||
"immed": true,
|
||||
"newcap": true,
|
||||
"trailing": true,
|
||||
"loopfunc": true,
|
||||
"quotmark": "single"
|
||||
}
|
||||
28
.npmignore
Normal file
28
.npmignore
Normal file
@@ -0,0 +1,28 @@
|
||||
dist/
|
||||
grunt/
|
||||
node_modules
|
||||
pkg/
|
||||
release_notes/
|
||||
spec/
|
||||
src/
|
||||
Gemfile
|
||||
Gemfile.lock
|
||||
Rakefile
|
||||
jasmine-core.gemspec
|
||||
.bundle/
|
||||
.gitignore
|
||||
.gitmodules
|
||||
.idea
|
||||
.jshintrc
|
||||
.rspec
|
||||
.sass-cache/
|
||||
.travis.yml
|
||||
*.sh
|
||||
*.py
|
||||
Gruntfile.js
|
||||
lib/jasmine-core.rb
|
||||
lib/jasmine-core/boot/
|
||||
lib/jasmine-core/spec
|
||||
lib/jasmine-core/version.rb
|
||||
lib/jasmine-core/*.py
|
||||
sauce_connect.log
|
||||
70
.travis.yml
Normal file
70
.travis.yml
Normal file
@@ -0,0 +1,70 @@
|
||||
language: ruby
|
||||
cache: bundler
|
||||
sudo: false
|
||||
|
||||
rvm: 2.2.2
|
||||
|
||||
script: $TEST_COMMAND
|
||||
|
||||
env:
|
||||
global:
|
||||
- USE_SAUCE=true
|
||||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
||||
- TEST_COMMAND="bash travis-core-script.sh"
|
||||
- JASMINE_BROWSER="firefox"
|
||||
- SAUCE_OS="Linux"
|
||||
- SAUCE_BROWSER_VERSION=''
|
||||
- secure: WSPWhlnC4mWSnSPquX+m1/BCu5ch5NygkaHuM2Nea7lD8oS3XLX8QncZZAsQ4lnNfqoDDuBOizG0AESiqNvE4y6x5qvLLTS6q+ce255ZEMZ71TBdZgDEEvGMEjOPPsVXiXyTQOP1lwOPlrbZvaPgWV7e11KIBab6DfFcQpnvDgo=
|
||||
- secure: SW7CJhZnwaNT749Gdnhvqb5rbXlAOsygUAzh9qhtyvbqXKkmJdBIEsO01YF6pbju1X2twE9JvWCOxeZju43NgQChJlPsGbjY2j3k/TdQeTAJesQe2K7ytwghunI30gjEovtRH0T3w1EmcKPH8yj5eBIcB2OYoJHx8KEC7e68q1g=
|
||||
|
||||
addons:
|
||||
sauce_connect: true
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- env:
|
||||
- USE_SAUCE=false
|
||||
- TEST_COMMAND="bash travis-node-script.sh"
|
||||
- env:
|
||||
- JASMINE_BROWSER="safari"
|
||||
- SAUCE_OS="OS X 10.11"
|
||||
- SAUCE_BROWSER_VERSION=9
|
||||
- env:
|
||||
- JASMINE_BROWSER="safari"
|
||||
- SAUCE_OS="OS X 10.10"
|
||||
- SAUCE_BROWSER_VERSION=8
|
||||
- env:
|
||||
- JASMINE_BROWSER="safari"
|
||||
- SAUCE_OS="OS X 10.9"
|
||||
- SAUCE_BROWSER_VERSION=7
|
||||
- env:
|
||||
- JASMINE_BROWSER="safari"
|
||||
- SAUCE_OS="OS X 10.8"
|
||||
- SAUCE_BROWSER_VERSION=6
|
||||
- env:
|
||||
- JASMINE_BROWSER="internet explorer"
|
||||
- SAUCE_OS="Windows 8.1"
|
||||
- SAUCE_BROWSER_VERSION=11
|
||||
- env:
|
||||
- JASMINE_BROWSER="internet explorer"
|
||||
- SAUCE_OS="Windows 8"
|
||||
- SAUCE_BROWSER_VERSION=10
|
||||
- env:
|
||||
- JASMINE_BROWSER="internet explorer"
|
||||
- SAUCE_OS="Windows 7"
|
||||
- SAUCE_BROWSER_VERSION=9
|
||||
- env:
|
||||
- JASMINE_BROWSER="internet explorer"
|
||||
- SAUCE_OS="Windows 7"
|
||||
- SAUCE_BROWSER_VERSION=8
|
||||
- env:
|
||||
- JASMINE_BROWSER="chrome"
|
||||
- SAUCE_OS="Linux"
|
||||
- SAUCE_BROWSER_VERSION=''
|
||||
- env:
|
||||
- JASMINE_BROWSER="phantomjs"
|
||||
- USE_SAUCE=false
|
||||
- env:
|
||||
- USE_SAUCE=false
|
||||
- JASMINE_BROWSER="phantomjs"
|
||||
- TEST_COMMAND="bash travis-docs-script.sh"
|
||||
@@ -1,44 +0,0 @@
|
||||
# Developing for Jasmine Core
|
||||
|
||||
## How to Contribute
|
||||
|
||||
We welcome your contributions - Thanks for helping make Jasmine a better project for everyone. Please review the backlog and discussion lists (the main group - [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js) and the developer's list - [http://groups.google.com/group/jasmine-js-dev](http://groups.google.com/group/jasmine-js-dev)) before starting work - what you're looking for may already have been done. If it hasn't, the community can help make your contribution better.
|
||||
|
||||
## How to write new Jasmine code
|
||||
|
||||
Or, How to make a successful pull request
|
||||
|
||||
* _Do not change the public interface_. Lots of projects depend on Jasmine and if you aren't careful you'll break them
|
||||
* _Be environment agnostic_ - server-side developers are just as important as browser developers
|
||||
* _Be browser agnostic_ - if you must rely on browser-specific functionality, please write it in a way that degrades gracefully
|
||||
* _Write specs_ - Jasmine's a testing framework; don't add functionality without test-driving it
|
||||
* _Ensure the *entire* test suite is green_ in all the big browsers, Node, and JSHint - your contribution shouldn't break Jasmine for other users
|
||||
|
||||
Follow these tips and your pull request, patch, or suggestion is much more likely to be integrated.
|
||||
|
||||
## Environment
|
||||
|
||||
Ruby, RubyGems and Rake are used in order to script the various file interactions. You will need to run on a system that supports Ruby in order to run Jasmine's specs.
|
||||
|
||||
Node.js is used to run most of the specs (the HTML-independent code) and should be present. Additionally, the JS Hint project scrubs the source code as part of the spec process.
|
||||
|
||||
## Development
|
||||
|
||||
All source code belongs in `src/`. The `core/` directory contains the bulk of Jasmine's functionality. This code should remain browser- and environment-agnostic. If your feature or fix cannot be, as mentioned above, please degrade gracefully. Any code that should only be in a non-browser environment should live in `src/console/`. Any code that depends on a browser (specifically, it expects `window` to be the global or `document` is present) should live in `src/html/`.
|
||||
|
||||
Please respect the code patterns as possible. For example, using `jasmine.getGlobal()` to get the global object so as to remain environment agnostic.
|
||||
|
||||
## Running Specs
|
||||
|
||||
As in all good projects, the `spec/` directory mirrors `src/` and follows the same rules. The browser runner will include and attempt to run all specs. The node runner will exclude any html-dependent specs (those in `spec/html/`).
|
||||
|
||||
You will notice that all specs are run against the built `jasmine.js` instead of the component source files. This is intentional as a way to ensure that the concatenation code is working correctly.
|
||||
|
||||
Please ensure all specs are green before committing.
|
||||
|
||||
There are rake tasks to help with getting green:
|
||||
* `rake spec` outputs the expected number of specs that should be run and attempts to run in browser and Node
|
||||
* `rake spec:browser` opens `spec/runner.html` in the default browser on MacOS. Please run this in at least Firefox and Chrome before committing
|
||||
* `rake spec:node` runs all the Jasmine specs in Node.js - it will complain if Node is not installed
|
||||
* `rake hint` runs all the files through JSHint and will complain about potential viable issues with your code. Fix them.
|
||||
|
||||
11
Gemfile
11
Gemfile
@@ -1,4 +1,9 @@
|
||||
source :rubygems
|
||||
gem "term-ansicolor", :require => "term/ansicolor"
|
||||
gem "rake"
|
||||
source 'https://rubygems.org'
|
||||
gem "jasmine", :git => 'https://github.com/jasmine/jasmine-gem.git'
|
||||
# gem "jasmine", path: "../jasmine-gem"
|
||||
|
||||
gemspec
|
||||
|
||||
gem "jasmine_selenium_runner", :github => 'jasmine/jasmine_selenium_runner'
|
||||
|
||||
gem "anchorman"
|
||||
|
||||
59
Gruntfile.js
Normal file
59
Gruntfile.js
Normal file
@@ -0,0 +1,59 @@
|
||||
module.exports = function(grunt) {
|
||||
var pkg = require("./package.json");
|
||||
global.jasmineVersion = pkg.version;
|
||||
|
||||
grunt.initConfig({
|
||||
pkg: pkg,
|
||||
jshint: require('./grunt/config/jshint.js'),
|
||||
concat: require('./grunt/config/concat.js'),
|
||||
compass: require('./grunt/config/compass.js'),
|
||||
compress: require('./grunt/config/compress.js')
|
||||
});
|
||||
|
||||
require('load-grunt-tasks')(grunt);
|
||||
|
||||
grunt.loadTasks('grunt/tasks');
|
||||
|
||||
grunt.registerTask('default', ['jshint:all']);
|
||||
|
||||
var version = require('./grunt/tasks/version.js');
|
||||
|
||||
grunt.registerTask('build:copyVersionToGem',
|
||||
"Propagates the version from package.json to version.rb",
|
||||
version.copyToGem);
|
||||
|
||||
grunt.registerTask('buildDistribution',
|
||||
'Builds and lints jasmine.js, jasmine-html.js, jasmine.css',
|
||||
[
|
||||
'compass',
|
||||
'jshint:beforeConcat',
|
||||
'concat',
|
||||
'jshint:afterConcat',
|
||||
'build:copyVersionToGem'
|
||||
]
|
||||
);
|
||||
|
||||
grunt.registerTask("execSpecsInNode",
|
||||
"Run Jasmine core specs in Node.js",
|
||||
function() {
|
||||
var done = this.async(),
|
||||
Jasmine = require('jasmine'),
|
||||
jasmineCore = require('./lib/jasmine-core.js'),
|
||||
jasmine = new Jasmine({jasmineCore: jasmineCore});
|
||||
|
||||
jasmine.loadConfigFile('./spec/support/jasmine.json');
|
||||
jasmine.onComplete(function(passed) {
|
||||
done(passed);
|
||||
});
|
||||
|
||||
jasmine.execute();
|
||||
}
|
||||
);
|
||||
|
||||
grunt.registerTask("execSpecsInNode:performance",
|
||||
"Run Jasmine performance specs in Node.js",
|
||||
function() {
|
||||
require("shelljs").exec("node_modules/.bin/jasmine JASMINE_CONFIG_PATH=spec/support/jasmine-performance.json");
|
||||
}
|
||||
);
|
||||
};
|
||||
5
MANIFEST.in
Normal file
5
MANIFEST.in
Normal file
@@ -0,0 +1,5 @@
|
||||
recursive-include . *.py
|
||||
include lib/jasmine-core/*.js
|
||||
include lib/jasmine-core/*.css
|
||||
include images/*.png
|
||||
include package.json
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2008-2011 Pivotal Labs
|
||||
Copyright (c) 2008-2017 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<a name="README">[Jasmine](http://pivotal.github.com/jasmine/)</a>
|
||||
=======
|
||||
**A JavaScript Testing Framework**
|
||||
|
||||
Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, [Node.js](http://nodejs.org) projects, or anywhere that JavaScript can run.
|
||||
|
||||
Documentation & guides live here: [http://pivotal.github.com/jasmine/](http://pivotal.github.com/jasmine/)
|
||||
|
||||
## What's Here?
|
||||
|
||||
*
|
||||
|
||||
|
||||
|
||||
|
||||
## Support
|
||||
|
||||
* Search past discussions: [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js)
|
||||
* Send an email to the list: [jasmine-js@googlegroups.com](jasmine-js@googlegroups.com)
|
||||
* Check the current build status: [ci.pivotallabs.com](http://ci.pivotallabs.com)
|
||||
* View the project backlog at Pivotal Tracker: [http://www.pivotaltracker.com/projects/10606](http://www.pivotaltracker.com/projects/10606)
|
||||
* Follow us on Twitter: [@JasmineBDD](http://twitter.com/JasmineBDD)
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
* [Davis W. Frank](mailto:dwfrank@pivotallabs.com), Pivotal Labs
|
||||
* [Rajan Agaskar](mailto:rajan@pivotallabs.com), Pivotal Labs
|
||||
* [Christian Williams](mailto:antixian666@gmail.com), Square
|
||||
|
||||
Copyright (c) 2008-2011 Pivotal Labs. This software is licensed under the MIT License.
|
||||
79
README.md
Normal file
79
README.md
Normal file
@@ -0,0 +1,79 @@
|
||||
<a name="README">[<img src="https://rawgithub.com/jasmine/jasmine/master/images/jasmine-horizontal.svg" width="400px" />](http://jasmine.github.io)</a>
|
||||
|
||||
[](https://travis-ci.org/jasmine/jasmine)
|
||||
[](https://codeclimate.com/github/pivotal/jasmine)
|
||||
|
||||
=======
|
||||
|
||||
**A JavaScript Testing Framework**
|
||||
|
||||
Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, [Node.js](http://nodejs.org) projects, or anywhere that JavaScript can run.
|
||||
|
||||
Documentation & guides live here: [http://jasmine.github.io](http://jasmine.github.io/)
|
||||
For a quick start guide of Jasmine 2.x, see the beginning of [http://jasmine.github.io/edge/introduction.html](http://jasmine.github.io/edge/introduction.html)
|
||||
|
||||
Upgrading from Jasmine 1.x? Check out the [2.0 release notes](https://github.com/jasmine/jasmine/blob/v2.0.0/release_notes/20.md) for a list of what's new (including breaking interface changes). You can also read the [upgrade guide](http://jasmine.github.io/2.0/upgrading.html).
|
||||
|
||||
## Contributing
|
||||
|
||||
Please read the [contributors' guide](https://github.com/jasmine/jasmine/blob/master/.github/CONTRIBUTING.md)
|
||||
|
||||
## Installation
|
||||
|
||||
For the Jasmine NPM module:<br>
|
||||
[https://github.com/jasmine/jasmine-npm](https://github.com/jasmine/jasmine-npm)
|
||||
|
||||
For the Jasmine Ruby Gem:<br>
|
||||
[https://github.com/jasmine/jasmine-gem](https://github.com/jasmine/jasmine-gem)
|
||||
|
||||
For the Jasmine Python Egg:<br>
|
||||
[https://github.com/jasmine/jasmine-py](https://github.com/jasmine/jasmine-py)
|
||||
|
||||
For the Jasmine headless browser gulp plugin:<br>
|
||||
[https://github.com/jasmine/gulp-jasmine-browser](https://github.com/jasmine/gulp-jasmine-browser)
|
||||
|
||||
To install Jasmine standalone on your local box (where **_{#.#.#}_** below is substituted by the release number downloaded):
|
||||
|
||||
* Download the standalone distribution for your desired release from the [releases page](https://github.com/jasmine/jasmine/releases)
|
||||
* Create a Jasmine directory in your project - `mkdir my-project/jasmine`
|
||||
* Move the dist to your project directory - `mv jasmine/dist/jasmine-standalone-{#.#.#}.zip my-project/jasmine`
|
||||
* Change directory - `cd my-project/jasmine`
|
||||
* Unzip the dist - `unzip jasmine-standalone-{#.#.#}.zip`
|
||||
|
||||
Add the following to your HTML file:
|
||||
|
||||
```html
|
||||
<link rel="shortcut icon" type="image/png" href="jasmine/lib/jasmine-core/jasmine_favicon.png">
|
||||
<link rel="stylesheet" type="text/css" href="jasmine/lib/jasmine-core/jasmine.css">
|
||||
|
||||
<script type="text/javascript" src="jasmine/lib/jasmine-core/jasmine.js"></script>
|
||||
<script type="text/javascript" src="jasmine/lib/jasmine-core/jasmine-html.js"></script>
|
||||
<script type="text/javascript" src="jasmine/lib/jasmine-core/boot.js"></script>
|
||||
```
|
||||
|
||||
## Supported environments
|
||||
|
||||
Jasmine tests itself across many browsers (Safari, Chrome, Firefox, PhantomJS, and new Internet Explorer) as well as node. To see the exact version tests are run against look at our [.travis.yml](https://github.com/jasmine/jasmine/blob/master/.travis.yml)
|
||||
|
||||
|
||||
## Support
|
||||
|
||||
* Search past discussions: [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js)
|
||||
* Send an email to the list: [jasmine-js@googlegroups.com](mailto:jasmine-js@googlegroups.com)
|
||||
* View the project backlog at Pivotal Tracker: [http://www.pivotaltracker.com/projects/10606](http://www.pivotaltracker.com/projects/10606)
|
||||
* Follow us on Twitter: [@JasmineBDD](http://twitter.com/JasmineBDD)
|
||||
|
||||
## Maintainers
|
||||
|
||||
* [Gregg Van Hove](mailto:gvanhove@pivotal.io), Pivotal Labs
|
||||
|
||||
### Maintainers Emeritus
|
||||
|
||||
* [Davis W. Frank](mailto:dwfrank@pivotal.io), Pivotal Labs
|
||||
* [Rajan Agaskar](mailto:rajan@pivotal.io), Pivotal Labs
|
||||
* [Greg Cobb](mailto:gcobb@pivotal.io), Pivotal Labs
|
||||
* [Chris Amavisca](mailto:camavisca@pivotal.io), Pivotal Labs
|
||||
* [Christian Williams](mailto:antixian666@gmail.com), Cloud Foundry
|
||||
* Sheel Choksi
|
||||
|
||||
Copyright (c) 2008-2017 Pivotal Labs. This software is licensed under the MIT License.
|
||||
73
RELEASE.md
Normal file
73
RELEASE.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# How to work on a Jasmine Release
|
||||
|
||||
## Development
|
||||
___Jasmine Core Maintainers Only___
|
||||
|
||||
Follow the instructions in `CONTRIBUTING.md` during development.
|
||||
|
||||
### Git Rules
|
||||
|
||||
Please work on feature branches.
|
||||
|
||||
Please attempt to keep commits to `master` small, but cohesive. If a feature is contained in a bunch of small commits (e.g., it has several wip commits or small work), please squash them when merging back to `master`.
|
||||
|
||||
### Version
|
||||
|
||||
We attempt to stick to [Semantic Versioning](http://semver.org/). Most of the time, development should be against a new minor version - fixing bugs and adding new features that are backwards compatible.
|
||||
|
||||
The current version lives in the file `/package.json`. This version will be the version number that is currently released. When releasing a new version, update `package.json` with the new version and `grunt build:copyVersionToGem` to update the gem version number.
|
||||
|
||||
This version is used by both `jasmine.js` and the `jasmine-core` Ruby gem.
|
||||
|
||||
Note that Jasmine should only use the "patch" version number in the following cases:
|
||||
|
||||
* Changes related to packaging for a specific platform (npm, gem, or pip).
|
||||
* Fixes for regressions.
|
||||
|
||||
When jasmine-core revs its major or minor version, the binding libraries should also rev to that version.
|
||||
|
||||
## Release
|
||||
|
||||
When ready to release - specs are all green and the stories are done:
|
||||
|
||||
1. Update the release notes in `release_notes` - use the Anchorman gem to generate the markdown file and edit accordingly
|
||||
1. Update the version in `package.json` to a release candidate
|
||||
1. Update any links or top-level landing page for the Github Pages
|
||||
|
||||
### Build standalone distribution
|
||||
|
||||
1. Build the standalone distribution with `grunt buildStandaloneDist`
|
||||
|
||||
### Release the Python egg
|
||||
|
||||
1. `python setup.py register sdist upload` You will need pypi credentials to upload the egg.
|
||||
|
||||
### Release the Ruby gem
|
||||
|
||||
1. Copy version to the Ruby gem with `grunt build:copyVersionToGem`
|
||||
1. __NOTE__: You will likely need to point to a local jasmine gem in order to run tests locally. _Do not_ push this version of the Gemfile.
|
||||
1. __NOTE__: You will likely need to push a new jasmine gem with a dependent version right after this release.
|
||||
1. Push these changes to GitHub and verify that this SHA is green
|
||||
1. `rake release` - tags the repo with the version, builds the `jasmine-core` gem, pushes the gem to Rubygems.org. In order to release you will have to ensure you have rubygems creds locally.
|
||||
|
||||
### Release the NPM
|
||||
|
||||
1. `npm adduser` to save your credentials locally
|
||||
1. `npm publish .` to publish what's in `package.json`
|
||||
|
||||
### Release the docs
|
||||
|
||||
Probably only need to do this when releasing a minor version, and not a patch version.
|
||||
|
||||
1. `cp -R edge ${version}` to copy the current edge docs to the new version
|
||||
1. Add a link to the new version in `index.html`
|
||||
|
||||
### Finally
|
||||
|
||||
1. Visit the [Releases page for Jasmine](https://github.com/jasmine/jasmine/releases), find the tag just pushed.
|
||||
1. Paste in a link to the correct release notes for this release. The link should reference the blob and tag correctly, and the markdown file for the notes.
|
||||
1. If it is a pre-release, mark it as such.
|
||||
1. Attach the standalone zipfile
|
||||
|
||||
|
||||
There should be a post to Pivotal Labs blog and a tweet to that link.
|
||||
37
Rakefile
37
Rakefile
@@ -1,33 +1,18 @@
|
||||
require "bundler"
|
||||
Bundler::GemHelper.install_tasks
|
||||
require "term/ansicolor"
|
||||
require "json"
|
||||
require "tilt"
|
||||
require "jasmine"
|
||||
unless ENV["JASMINE_BROWSER"] == 'phantomjs'
|
||||
require "jasmine_selenium_runner"
|
||||
end
|
||||
load "jasmine/tasks/jasmine.rake"
|
||||
|
||||
Dir["#{File.dirname(__FILE__)}/tasks/**/*.rb"].each do |file|
|
||||
require file
|
||||
namespace :jasmine do
|
||||
task :set_env do
|
||||
ENV['JASMINE_CONFIG_PATH'] ||= 'spec/support/jasmine.yml'
|
||||
end
|
||||
end
|
||||
|
||||
task :default => :spec
|
||||
task "jasmine:configure" => "jasmine:set_env"
|
||||
|
||||
task :require_pages_submodule do
|
||||
raise "Submodule for Github Pages isn't present. Run git submodule update --init" unless pages_submodule_present
|
||||
end
|
||||
|
||||
task :require_node do
|
||||
raise "\nNode.js is required to develop code for Jasmine. Please visit http://nodejs.org to install.\n\n" unless node_installed?
|
||||
end
|
||||
|
||||
def pages_submodule_present
|
||||
File.exist?('pages/download.html')
|
||||
end
|
||||
|
||||
def node_installed?
|
||||
`which node` =~ /node/
|
||||
end
|
||||
|
||||
class String
|
||||
include Term::ANSIColor
|
||||
end
|
||||
|
||||
Term::ANSIColor.coloring = STDOUT.isatty
|
||||
task :default => "jasmine:ci"
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
# How to work on a Jasmine Release
|
||||
|
||||
## Development
|
||||
___Jasmine Core Maintainers Only___
|
||||
|
||||
Follow the instructions in `Contribute.markdown` during development.
|
||||
|
||||
### Git Commits
|
||||
|
||||
|
||||
### Version
|
||||
|
||||
We attempt to stick to [Semantic Versioning](). Most of the time, development should be against a new minor version - fixing bugs and adding new features that are backwards compatible.
|
||||
|
||||
The current version lives in the file `src/version.json`. This file should be set to the version that is _currently_ under development. That is, if version 1.0.0 is the current release then version should be incremented say, to 1.1.0.
|
||||
|
||||
This version is used by both `jasmine.js` and the `jasmine-core` Ruby gem.
|
||||
|
||||
|
||||
### Update the Github Pages (as needed)
|
||||
|
||||
Github pages have to exist in a branch called gh-pages in order for their app to serve them. This repo adds that branch as a submodule under the `pages` directory. This is a bit of a hack, but it allows us to work with the pages and the source at the same time and with one set of rake tasks.
|
||||
|
||||
If you want to submit changes to this repo and aren't a Pivotal Labs employee, you can fork and work in the `gh-pages` branch. You won't be able to edit the pages in the submodule off of master.
|
||||
|
||||
The pages are built with [Frank](https://github.com/blahed/frank). All the source for these pages live in the `pages/pages_source` directory.
|
||||
|
||||
## Release
|
||||
|
||||
When ready to release - specs are all green and the stories are done:
|
||||
|
||||
1. Update the version in `version.json` to a release candidate - add an `rc` property with a value of 1
|
||||
1. Update any comments on the public interfaces
|
||||
1. `rake doc` - builds the `jsdoc` pages
|
||||
1. Update any links or top-level landing page for the Github Pages
|
||||
1. `rake standalone` - builds the standalone distribution ZIP file
|
||||
1. `rake build_pages` - builds the Github Pages
|
||||
1. `rake release` - tags the repo with the version, builds the `jasmine-core` gem, pushes the gem to Rubygems.org
|
||||
|
||||
There should be a post to Pivotal Labs blog and a tweet to that link.
|
||||
40
bower.json
Normal file
40
bower.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "jasmine-core",
|
||||
"homepage": "http://jasmine.github.io",
|
||||
"authors": [
|
||||
"slackersoft <gregg@slackersoft.net>"
|
||||
],
|
||||
"description": "Official packaging of Jasmine's core files",
|
||||
"keywords": [
|
||||
"test",
|
||||
"jasmine",
|
||||
"tdd",
|
||||
"bdd"
|
||||
],
|
||||
"license": "MIT",
|
||||
"moduleType": "globals",
|
||||
"main": "lib/jasmine-core/jasmine.js",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"dist",
|
||||
"grunt",
|
||||
"node_modules",
|
||||
"pkg",
|
||||
"release_notes",
|
||||
"spec",
|
||||
"src",
|
||||
"Gemfile",
|
||||
"Gemfile.lock",
|
||||
"Rakefile",
|
||||
"jasmine-core.gemspec",
|
||||
"*.sh",
|
||||
"*.py",
|
||||
"Gruntfile.js",
|
||||
"lib/jasmine-core.rb",
|
||||
"lib/jasmine-core/boot/",
|
||||
"lib/jasmine-core/spec",
|
||||
"lib/jasmine-core/version.rb",
|
||||
"lib/jasmine-core/*.py",
|
||||
"sauce_connect.log"
|
||||
]
|
||||
}
|
||||
11
grunt/config/compass.js
Normal file
11
grunt/config/compass.js
Normal file
@@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
jasmine: {
|
||||
options: {
|
||||
cssDir: 'lib/jasmine-core/',
|
||||
sassDir: 'src/html',
|
||||
outputStyle: 'compact',
|
||||
noLineComments: true,
|
||||
bundleExec: true
|
||||
}
|
||||
}
|
||||
};
|
||||
66
grunt/config/compress.js
Normal file
66
grunt/config/compress.js
Normal file
@@ -0,0 +1,66 @@
|
||||
var standaloneLibDir = "lib/jasmine-" + jasmineVersion;
|
||||
|
||||
function root(path) { return "./" + path; }
|
||||
function libJasmineCore(path) { return root("lib/jasmine-core/" + path); }
|
||||
function libConsole() { return "lib/console/" }
|
||||
function dist(path) { return root("dist/" + path); }
|
||||
|
||||
module.exports = {
|
||||
standalone: {
|
||||
options: {
|
||||
archive: root("dist/jasmine-standalone-" + global.jasmineVersion + ".zip")
|
||||
},
|
||||
|
||||
files: [
|
||||
{ src: [ root("MIT.LICENSE") ] },
|
||||
{
|
||||
src: [ "jasmine_favicon.png"],
|
||||
dest: standaloneLibDir,
|
||||
expand: true,
|
||||
cwd: root("images")
|
||||
},
|
||||
{
|
||||
src: [
|
||||
"jasmine.js",
|
||||
"jasmine-html.js",
|
||||
"jasmine.css"
|
||||
],
|
||||
dest: standaloneLibDir,
|
||||
expand: true,
|
||||
cwd: libJasmineCore("")
|
||||
},
|
||||
{
|
||||
src: [
|
||||
"console.js"
|
||||
],
|
||||
dest: standaloneLibDir,
|
||||
expand: true,
|
||||
cwd: libConsole()
|
||||
},
|
||||
{
|
||||
src: [ "boot.js" ],
|
||||
dest: standaloneLibDir,
|
||||
expand: true,
|
||||
cwd: libJasmineCore("boot")
|
||||
},
|
||||
{
|
||||
src: [ "SpecRunner.html" ],
|
||||
dest: root(""),
|
||||
expand: true,
|
||||
cwd: dist("tmp")
|
||||
},
|
||||
{
|
||||
src: [ "*.js" ],
|
||||
dest: "src",
|
||||
expand: true,
|
||||
cwd: libJasmineCore("example/src/")
|
||||
},
|
||||
{
|
||||
src: [ "*.js" ],
|
||||
dest: "spec",
|
||||
expand: true,
|
||||
cwd: libJasmineCore("example/spec/")
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
62
grunt/config/concat.js
Normal file
62
grunt/config/concat.js
Normal file
@@ -0,0 +1,62 @@
|
||||
var grunt = require('grunt');
|
||||
|
||||
function license() {
|
||||
var currentYear = "" + new Date(Date.now()).getFullYear();
|
||||
|
||||
return grunt.template.process(
|
||||
grunt.file.read("grunt/templates/licenseBanner.js.jst"),
|
||||
{ data: { currentYear: currentYear}});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
'jasmine-html': {
|
||||
src: [
|
||||
'src/html/requireHtml.js',
|
||||
'src/html/HtmlReporter.js',
|
||||
'src/html/HtmlSpecFilter.js',
|
||||
'src/html/ResultsNode.js',
|
||||
'src/html/QueryString.js'
|
||||
],
|
||||
dest: 'lib/jasmine-core/jasmine-html.js'
|
||||
},
|
||||
jasmine: {
|
||||
src: [
|
||||
'src/core/requireCore.js',
|
||||
'src/core/matchers/requireMatchers.js',
|
||||
'src/core/base.js',
|
||||
'src/core/util.js',
|
||||
'src/core/Spec.js',
|
||||
'src/core/Order.js',
|
||||
'src/core/Env.js',
|
||||
'src/core/JsApiReporter.js',
|
||||
'src/core/PrettyPrinter',
|
||||
'src/core/Suite',
|
||||
'src/core/**/*.js',
|
||||
'src/version.js'
|
||||
],
|
||||
dest: 'lib/jasmine-core/jasmine.js'
|
||||
},
|
||||
boot: {
|
||||
src: ['lib/jasmine-core/boot/boot.js'],
|
||||
dest: 'lib/jasmine-core/boot.js'
|
||||
},
|
||||
nodeBoot: {
|
||||
src: ['lib/jasmine-core/boot/node_boot.js'],
|
||||
dest: 'lib/jasmine-core/node_boot.js'
|
||||
},
|
||||
console: {
|
||||
src: [
|
||||
'src/console/requireConsole.js',
|
||||
'src/console/ConsoleReporter.js'
|
||||
],
|
||||
dest: 'lib/console/console.js'
|
||||
},
|
||||
options: {
|
||||
banner: license(),
|
||||
process: {
|
||||
data: {
|
||||
version: global.jasmineVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
11
grunt/config/jshint.js
Normal file
11
grunt/config/jshint.js
Normal file
@@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
beforeConcat: ['src/**/*.js'],
|
||||
afterConcat: [
|
||||
'lib/jasmine-core/jasmine-html.js',
|
||||
'lib/jasmine-core/jasmine.js'
|
||||
],
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
},
|
||||
all: ['src/**/*.js']
|
||||
};
|
||||
31
grunt/tasks/build_standalone.js
Normal file
31
grunt/tasks/build_standalone.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var grunt = require("grunt");
|
||||
|
||||
function standaloneTmpDir(path) { return "dist/tmp/" + path; }
|
||||
|
||||
grunt.registerTask("build:compileSpecRunner",
|
||||
"Processes the spec runner template and writes to a tmp file",
|
||||
function() {
|
||||
var runnerHtml = grunt.template.process(
|
||||
grunt.file.read("grunt/templates/SpecRunner.html.jst"),
|
||||
{ data: { jasmineVersion: global.jasmineVersion }});
|
||||
|
||||
grunt.file.write(standaloneTmpDir("SpecRunner.html"), runnerHtml);
|
||||
}
|
||||
);
|
||||
|
||||
grunt.registerTask("build:cleanSpecRunner",
|
||||
"Deletes the tmp spec runner file",
|
||||
function() {
|
||||
grunt.file.delete(standaloneTmpDir(""));
|
||||
}
|
||||
);
|
||||
|
||||
grunt.registerTask("buildStandaloneDist",
|
||||
"Builds a standalone distribution",
|
||||
[
|
||||
"buildDistribution",
|
||||
"build:compileSpecRunner",
|
||||
"compress:standalone",
|
||||
"build:cleanSpecRunner"
|
||||
]
|
||||
);
|
||||
14
grunt/tasks/version.js
Normal file
14
grunt/tasks/version.js
Normal file
@@ -0,0 +1,14 @@
|
||||
var grunt = require("grunt");
|
||||
|
||||
function gemLib(path) { return './lib/jasmine-core/' + path; }
|
||||
function nodeToRuby(version) { return version.replace('-', '.'); }
|
||||
|
||||
module.exports = {
|
||||
copyToGem: function() {
|
||||
var versionRb = grunt.template.process(
|
||||
grunt.file.read("grunt/templates/version.rb.jst"),
|
||||
{ data: { jasmineVersion: nodeToRuby(global.jasmineVersion) }});
|
||||
|
||||
grunt.file.write(gemLib("version.rb"), versionRb);
|
||||
}
|
||||
};
|
||||
26
grunt/templates/SpecRunner.html.jst
Normal file
26
grunt/templates/SpecRunner.html.jst
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Jasmine Spec Runner v<%= jasmineVersion %></title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="lib/jasmine-<%= jasmineVersion %>/jasmine_favicon.png">
|
||||
<link rel="stylesheet" href="lib/jasmine-<%= jasmineVersion %>/jasmine.css">
|
||||
|
||||
<script src="lib/jasmine-<%= jasmineVersion %>/jasmine.js"></script>
|
||||
<script src="lib/jasmine-<%= jasmineVersion %>/jasmine-html.js"></script>
|
||||
<script src="lib/jasmine-<%= jasmineVersion %>/boot.js"></script>
|
||||
|
||||
<!-- include source files here... -->
|
||||
<script src="src/Player.js"></script>
|
||||
<script src="src/Song.js"></script>
|
||||
|
||||
<!-- include spec files here... -->
|
||||
<script src="spec/SpecHelper.js"></script>
|
||||
<script src="spec/PlayerSpec.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
22
grunt/templates/licenseBanner.js.jst
Normal file
22
grunt/templates/licenseBanner.js.jst
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright (c) 2008-<%= currentYear %> Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
9
grunt/templates/version.rb.jst
Normal file
9
grunt/templates/version.rb.jst
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# DO NOT Edit this file. Canonical version of Jasmine lives in the repo's package.json. This file is generated
|
||||
# by a grunt task when the standalone release is built.
|
||||
#
|
||||
module Jasmine
|
||||
module Core
|
||||
VERSION = "<%= jasmineVersion %>"
|
||||
end
|
||||
end
|
||||
0
images/__init__.py
Normal file
0
images/__init__.py
Normal file
BIN
images/jasmine-horizontal.png
Normal file
BIN
images/jasmine-horizontal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
102
images/jasmine-horizontal.svg
Normal file
102
images/jasmine-horizontal.svg
Normal file
@@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
width="681.96252"
|
||||
height="187.5"
|
||||
id="svg2"
|
||||
xml:space="preserve"><metadata
|
||||
id="metadata8"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs6"><clipPath
|
||||
id="clipPath18"><path
|
||||
d="M 0,1500 0,0 l 5455.74,0 0,1500 L 0,1500 z"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path20" /></clipPath></defs><g
|
||||
transform="matrix(1.25,0,0,-1.25,0,187.5)"
|
||||
id="g10"><g
|
||||
transform="scale(0.1,0.1)"
|
||||
id="g12"><g
|
||||
id="g14"><g
|
||||
clip-path="url(#clipPath18)"
|
||||
id="g16"><path
|
||||
d="m 1544,599.434 c 0.92,-40.352 25.68,-81.602 71.53,-81.602 27.51,0 47.68,12.832 61.44,35.754 12.83,22.93 12.83,56.852 12.83,82.527 l 0,329.184 -71.52,0 0,104.543 266.83,0 0,-104.543 -70.6,0 0,-344.77 c 0,-58.691 -3.68,-104.531 -44.93,-152.218 -36.68,-42.18 -96.28,-66.02 -153.14,-66.02 -117.37,0 -207.24,77.941 -202.64,197.145 l 130.2,0"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path22"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 2301.4,662.695 c 0,80.703 -66.94,145.813 -147.63,145.813 -83.44,0 -147.63,-68.781 -147.63,-151.301 0,-79.785 66.94,-145.801 145.8,-145.801 84.35,0 149.46,67.852 149.46,151.289 z m -1.83,-181.547 c -35.77,-54.097 -93.53,-78.859 -157.72,-78.859 -140.3,0 -251.24,116.449 -251.24,254.918 0,142.129 113.7,260.41 256.74,260.41 63.27,0 118.29,-29.336 152.22,-82.523 l 0,69.687 175.14,0 0,-104.527 -61.44,0 0,-280.598 61.44,0 0,-104.527 -175.14,0 0,66.019"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path24"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 2622.33,557.258 c 3.67,-44.016 33.01,-73.348 78.86,-73.348 33.93,0 66.93,23.824 66.93,60.504 0,48.606 -45.84,56.856 -83.44,66.941 -85.28,22.004 -178.81,48.606 -178.81,155.879 0,93.536 78.86,147.633 165.98,147.633 44,0 83.43,-9.176 110.94,-44.008 l 0,33.922 82.53,0 0,-132.965 -108.21,0 c -1.83,34.856 -28.42,57.774 -63.26,57.774 -30.26,0 -62.35,-17.422 -62.35,-51.348 0,-45.847 44.93,-55.93 80.69,-64.18 88.02,-20.175 182.47,-47.695 182.47,-157.734 0,-99.027 -83.44,-154.039 -175.13,-154.039 -49.53,0 -94.46,15.582 -126.55,53.18 l 0,-40.34 -85.27,0 0,142.129 114.62,0"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path26"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 2988.18,800.254 -63.26,0 0,104.527 165.05,0 0,-73.355 c 31.18,51.347 78.86,85.277 141.21,85.277 67.85,0 124.71,-41.258 152.21,-102.699 26.6,62.351 92.62,102.699 160.47,102.699 53.19,0 105.46,-22 141.21,-62.351 38.52,-44.938 38.52,-93.532 38.52,-149.457 l 0,-185.239 63.27,0 0,-104.527 -238.42,0 0,104.527 63.28,0 0,157.715 c 0,32.102 0,60.527 -14.67,88.957 -18.34,26.582 -48.61,40.344 -79.77,40.344 -30.26,0 -63.28,-12.844 -82.53,-36.672 -22.93,-29.355 -22.93,-56.863 -22.93,-92.629 l 0,-157.715 63.27,0 0,-104.527 -238.41,0 0,104.527 63.28,0 0,150.383 c 0,29.348 0,66.023 -14.67,91.699 -15.59,29.336 -47.69,44.934 -80.7,44.934 -31.18,0 -57.77,-11.008 -77.94,-35.774 -24.77,-30.253 -26.6,-62.343 -26.6,-99.941 l 0,-151.301 63.27,0 0,-104.527 -238.4,0 0,104.527 63.26,0 0,280.598"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path28"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 3998.66,951.547 -111.87,0 0,118.293 111.87,0 0,-118.293 z m 0,-431.891 63.27,0 0,-104.527 -239.33,0 0,104.527 64.19,0 0,280.598 -63.27,0 0,104.527 175.14,0 0,-385.125"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path30"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 4159.12,800.254 -63.27,0 0,104.527 175.14,0 0,-69.687 c 29.35,54.101 84.36,80.699 144.87,80.699 53.19,0 105.45,-22.016 141.22,-60.527 40.34,-44.934 41.26,-88.032 41.26,-143.957 l 0,-191.653 63.27,0 0,-104.527 -238.4,0 0,104.527 63.26,0 0,158.637 c 0,30.262 0,61.434 -19.26,88.035 -20.17,26.582 -53.18,39.414 -86.19,39.414 -33.93,0 -68.77,-13.75 -88.94,-41.25 -21.09,-27.5 -21.09,-69.687 -21.09,-102.707 l 0,-142.129 63.26,0 0,-104.527 -238.4,0 0,104.527 63.27,0 0,280.598"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path32"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 5082.48,703.965 c -19.24,70.605 -81.6,115.547 -154.04,115.547 -66.04,0 -129.3,-51.348 -143.05,-115.547 l 297.09,0 z m 85.27,-144.883 c -38.51,-93.523 -129.27,-156.793 -231.05,-156.793 -143.07,0 -257.68,111.871 -257.68,255.836 0,144.883 109.12,261.328 254.91,261.328 67.87,0 135.72,-30.258 183.39,-78.863 48.62,-51.344 68.79,-113.695 68.79,-183.383 l -3.67,-39.434 -396.13,0 c 14.67,-67.863 77.03,-117.363 146.72,-117.363 48.59,0 90.76,18.328 118.28,58.672 l 116.44,0"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path34"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 690.895,850.703 90.75,0 22.543,31.035 0,243.122 -135.829,0 0,-243.141 22.536,-31.016"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path36"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 632.395,742.258 28.039,86.304 -22.551,31.04 -231.223,75.128 -41.976,-129.183 231.257,-75.137 36.454,11.848"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path38"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 717.449,653.105 -73.41,53.36 -36.488,-11.875 -142.903,-196.692 109.883,-79.828 142.918,196.703 0,38.332"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path40"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 828.52,706.465 -73.426,-53.34 0.011,-38.359 L 898.004,418.07 1007.9,497.898 864.973,694.609 828.52,706.465"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path42"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 812.086,828.586 28.055,-86.32 36.484,-11.836 231.225,75.117 -41.97,129.183 -231.239,-75.14 -22.555,-31.004"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path44"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 736.301,1335.88 c -323.047,0 -585.875,-262.78 -585.875,-585.782 0,-323.118 262.828,-585.977 585.875,-585.977 323.019,0 585.809,262.859 585.809,585.977 0,323.002 -262.79,585.782 -585.809,585.782 l 0,0 z m 0,-118.61 c 257.972,0 467.189,-209.13 467.189,-467.172 0,-258.129 -209.217,-467.348 -467.189,-467.348 -258.074,0 -467.254,209.219 -467.254,467.348 0,258.042 209.18,467.172 467.254,467.172"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path46"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 1091.13,619.883 -175.771,57.121 11.629,35.808 175.762,-57.121 -11.62,-35.808"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path48"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="M 866.957,902.074 836.5,924.199 945.121,1073.73 975.586,1051.61 866.957,902.074"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path50"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="M 607.465,903.445 498.855,1052.97 529.32,1075.1 637.93,925.566 607.465,903.445"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path52"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 380.688,622.129 -11.626,35.801 175.758,57.09 11.621,-35.801 -175.753,-57.09"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path54"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 716.289,376.59 37.6406,0 0,184.816 -37.6406,0 0,-184.816 z"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path56"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /></g></g></g></g></svg>
|
||||
|
After Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 905 B After Width: | Height: | Size: 1.5 KiB |
@@ -6,17 +6,18 @@ Gem::Specification.new do |s|
|
||||
s.name = "jasmine-core"
|
||||
s.version = Jasmine::Core::VERSION
|
||||
s.platform = Gem::Platform::RUBY
|
||||
s.authors = ["Rajan Agaskar", "Davis Frank", "Christian Williams"]
|
||||
s.authors = ["Gregg Van Hove"]
|
||||
s.summary = %q{JavaScript BDD framework}
|
||||
s.description = %q{Test your JavaScript without any framework dependencies, in any environment, and with a nice descriptive syntax.}
|
||||
s.email = %q{jasmine-js@googlegroups.com}
|
||||
s.homepage = "http://pivotal.github.com/jasmine"
|
||||
s.homepage = "http://jasmine.github.io"
|
||||
s.rubyforge_project = "jasmine-core"
|
||||
s.license = "MIT"
|
||||
|
||||
s.files = Dir.glob("./lib/**/*") + Dir.glob("./lib/jasmine-core/spec/**/*.js")
|
||||
s.require_paths = ["lib"]
|
||||
s.add_development_dependency "term-ansicolor"
|
||||
s.add_development_dependency "json_pure", ">= 1.4.3"
|
||||
s.add_development_dependency "frank"
|
||||
s.add_development_dependency "ragaskar-jsdoc_helper"
|
||||
s.add_development_dependency "rake"
|
||||
s.add_development_dependency "sauce-connect"
|
||||
s.add_development_dependency "compass"
|
||||
s.add_development_dependency "jasmine_selenium_runner", ">= 0.2.0"
|
||||
end
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<div align="center">{+new Link().toFile("index.html").withText("Class Index")+}
|
||||
| {+new Link().toFile("files.html").withText("File Index")+}</div>
|
||||
<hr />
|
||||
<h2>Classes</h2>
|
||||
<ul class="classList">
|
||||
<for each="thisClass" in="data">
|
||||
<li>{!
|
||||
if (thisClass.alias == "_global_") {
|
||||
output += "<i>"+new Link().toClass(thisClass.alias)+"</i>";
|
||||
}
|
||||
else {
|
||||
output += new Link().toClass(thisClass.alias);
|
||||
}
|
||||
!}</li>
|
||||
</for>
|
||||
</ul>
|
||||
<hr />
|
||||
@@ -1,56 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}"" />
|
||||
{! Link.base = ""; /* all generated links will be relative to this */ !}
|
||||
<title>JsDoc Reference - File Index</title>
|
||||
<meta name="generator" content="JsDoc Toolkit" />
|
||||
|
||||
<style type="text/css">
|
||||
{+include("static/default.css")+}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{+include("static/header.html")+}
|
||||
|
||||
<div id="index">
|
||||
{+publish.classesIndex+}
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<h1 class="classTitle">File Index</h1>
|
||||
|
||||
<for each="item" in="data">
|
||||
<div>
|
||||
<h2>{+new Link().toSrc(item.alias).withText(item.name)+}</h2>
|
||||
<if test="item.desc">{+resolveLinks(summarize(item.desc))+}</if>
|
||||
<dl>
|
||||
<if test="item.author">
|
||||
<dt class="heading">Author:</dt>
|
||||
<dd>{+item.author+}</dd>
|
||||
</if>
|
||||
<if test="item.version">
|
||||
<dt class="heading">Version:</dt>
|
||||
<dd>{+item.version+}</dd>
|
||||
</if>
|
||||
{! var locations = item.comment.getTag('location').map(function($){return $.toString().replace(/(^\$ ?| ?\$$)/g, '').replace(/^HeadURL: https:/g, 'http:');}) !}
|
||||
<if test="locations.length">
|
||||
<dt class="heading">Location:</dt>
|
||||
<for each="location" in="locations">
|
||||
<dd><a href="{+location+}">{+location+}</a></dd>
|
||||
</for>
|
||||
</if>
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
</for>
|
||||
|
||||
</div>
|
||||
<div class="fineprint" style="clear:both">
|
||||
<if test="JSDOC.opt.D.copyright">©{+JSDOC.opt.D.copyright+}<br /></if>
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,646 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
|
||||
<meta name="generator" content="JsDoc Toolkit" />
|
||||
{! Link.base = "../"; /* all generated links will be relative to this */ !}
|
||||
<title>JsDoc Reference - {+data.alias+}</title>
|
||||
|
||||
<style type="text/css">
|
||||
{+include("static/default.css")+}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- ============================== header ================================= -->
|
||||
<!-- begin static/header.html -->
|
||||
{+include("static/header.html")+}
|
||||
<!-- end static/header.html -->
|
||||
|
||||
<!-- ============================== classes index ============================ -->
|
||||
<div id="index">
|
||||
<!-- begin publish.classesIndex -->
|
||||
{+publish.classesIndex+}
|
||||
<!-- end publish.classesIndex -->
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<!-- ============================== class title ============================ -->
|
||||
<h1 class="classTitle">
|
||||
{!
|
||||
var classType = "";
|
||||
|
||||
if (data.isBuiltin()) {
|
||||
classType += "Built-In ";
|
||||
}
|
||||
|
||||
if (data.isNamespace) {
|
||||
if (data.is('FUNCTION')) {
|
||||
classType += "Function ";
|
||||
}
|
||||
classType += "Namespace ";
|
||||
}
|
||||
else {
|
||||
classType += "Class ";
|
||||
}
|
||||
!}
|
||||
{+classType+}{+data.alias+}
|
||||
</h1>
|
||||
|
||||
<!-- ============================== class summary ========================== -->
|
||||
<p class="description">
|
||||
<if test="data.augments.length"><br />Extends
|
||||
{+
|
||||
data.augments
|
||||
.sort()
|
||||
.map(
|
||||
function($) { return new Link().toSymbol($); }
|
||||
)
|
||||
.join(", ")
|
||||
+}.<br />
|
||||
</if>
|
||||
|
||||
{+resolveLinks(data.classDesc)+}
|
||||
|
||||
<if test="!data.isBuiltin()">{# isn't defined in any file #}
|
||||
<br /><i>Defined in: </i> {+new Link().toSrc(data.srcFile)+}.
|
||||
</if>
|
||||
</p>
|
||||
|
||||
<!-- ============================== constructor summary ==================== -->
|
||||
<if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
|
||||
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class {+data.alias+}.">
|
||||
<caption>{+classType+}Summary</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Constructor Attributes</th>
|
||||
<th scope="col">Constructor Name and Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="attributes">{!
|
||||
if (data.isPrivate) output += "<private> ";
|
||||
if (data.isInner) output += "<inner> ";
|
||||
!} </td>
|
||||
<td class="nameDescription" {!if (data.comment.getTag("hilited").length){output += 'style="color: red"'}!}>
|
||||
<div class="fixedFont">
|
||||
<b>{+ new Link().toSymbol(data.alias).inner('constructor')+}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
|
||||
</div>
|
||||
<div class="description">{+resolveLinks(summarize(data.desc))+}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</if>
|
||||
|
||||
<!-- ============================== properties summary ===================== -->
|
||||
<if test="data.properties.length">
|
||||
{! var ownProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !}
|
||||
<if test="ownProperties.length">
|
||||
<table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class {+data.alias+}.">
|
||||
<caption>Field Summary</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Field Attributes</th>
|
||||
<th scope="col">Field Name and Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<for each="member" in="ownProperties">
|
||||
<tr>
|
||||
<td class="attributes">{!
|
||||
if (member.isPrivate) output += "<private> ";
|
||||
if (member.isInner) output += "<inner> ";
|
||||
if (member.isStatic) output += "<static> ";
|
||||
if (member.isConstant) output += "<constant> ";
|
||||
!} </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">
|
||||
<if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>
|
||||
</div>
|
||||
<div class="description">{+resolveLinks(summarize(member.desc))+}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</for>
|
||||
</tbody>
|
||||
</table>
|
||||
</if>
|
||||
|
||||
<if test="data.inheritsFrom.length">
|
||||
<dl class="inheritsList">
|
||||
{!
|
||||
var borrowedMembers = data.properties.filter(function($) {return $.memberOf != data.alias});
|
||||
|
||||
var contributers = [];
|
||||
borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
|
||||
for (var i = 0, l = contributers.length; i < l; i++) {
|
||||
output +=
|
||||
"<dt>Fields borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
|
||||
+
|
||||
"<dd>" +
|
||||
borrowedMembers
|
||||
.filter(
|
||||
function($) { return $.memberOf == contributers[i] }
|
||||
)
|
||||
.sort(makeSortby("name"))
|
||||
.map(
|
||||
function($) { return new Link().toSymbol($.alias).withText($.name) }
|
||||
)
|
||||
.join(", ")
|
||||
+
|
||||
"</dd>";
|
||||
}
|
||||
!}
|
||||
</dl>
|
||||
</if>
|
||||
</if>
|
||||
|
||||
<!-- ============================== methods summary ======================== -->
|
||||
<if test="data.methods.length">
|
||||
{! var ownMethods = data.methods.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !}
|
||||
<if test="ownMethods.length">
|
||||
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class {+data.alias+}.">
|
||||
<caption>Method Summary</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Method Attributes</th>
|
||||
<th scope="col">Method Name and Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<for each="member" in="ownMethods">
|
||||
<tr>
|
||||
<td class="attributes">{!
|
||||
if (member.isPrivate) output += "<private> ";
|
||||
if (member.isInner) output += "<inner> ";
|
||||
if (member.isStatic) output += "<static> ";
|
||||
!} </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>{+makeSignature(member.params)+}
|
||||
</div>
|
||||
<div class="description">{+resolveLinks(summarize(member.desc))+}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</for>
|
||||
</tbody>
|
||||
</table>
|
||||
</if>
|
||||
|
||||
<if test="data.inheritsFrom.length">
|
||||
<dl class="inheritsList">
|
||||
{!
|
||||
var borrowedMembers = data.methods.filter(function($) {return $.memberOf != data.alias});
|
||||
var contributers = [];
|
||||
borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
|
||||
for (var i = 0, l = contributers.length; i < l; i++) {
|
||||
output +=
|
||||
"<dt>Methods borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
|
||||
+
|
||||
"<dd>" +
|
||||
borrowedMembers
|
||||
.filter(
|
||||
function($) { return $.memberOf == contributers[i] }
|
||||
)
|
||||
.sort(makeSortby("name"))
|
||||
.map(
|
||||
function($) { return new Link().toSymbol($.alias).withText($.name) }
|
||||
)
|
||||
.join(", ")
|
||||
+
|
||||
"</dd>";
|
||||
}
|
||||
|
||||
!}
|
||||
</dl>
|
||||
</if>
|
||||
</if>
|
||||
<!-- ============================== events summary ======================== -->
|
||||
<if test="data.events.length">
|
||||
{! var ownEvents = data.events.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !}
|
||||
<if test="ownEvents.length">
|
||||
<table class="summaryTable" cellspacing="0" summary="A summary of the events documented in the class {+data.alias+}.">
|
||||
<caption>Event Summary</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Event Attributes</th>
|
||||
<th scope="col">Event Name and Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<for each="member" in="ownEvents">
|
||||
<tr>
|
||||
<td class="attributes">{!
|
||||
if (member.isPrivate) output += "<private> ";
|
||||
if (member.isInner) output += "<inner> ";
|
||||
if (member.isStatic) output += "<static> ";
|
||||
!} </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>{+makeSignature(member.params)+}
|
||||
</div>
|
||||
<div class="description">{+resolveLinks(summarize(member.desc))+}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</for>
|
||||
</tbody>
|
||||
</table>
|
||||
</if>
|
||||
|
||||
<if test="data.inheritsFrom.length">
|
||||
<dl class="inheritsList">
|
||||
{!
|
||||
var borrowedMembers = data.events.filter(function($) {return $.memberOf != data.alias});
|
||||
var contributers = [];
|
||||
borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
|
||||
for (var i = 0, l = contributers.length; i < l; i++) {
|
||||
output +=
|
||||
"<dt>Events borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
|
||||
+
|
||||
"<dd>" +
|
||||
borrowedMembers
|
||||
.filter(
|
||||
function($) { return $.memberOf == contributers[i] }
|
||||
)
|
||||
.sort(makeSortby("name"))
|
||||
.map(
|
||||
function($) { return new Link().toSymbol($.alias).withText($.name) }
|
||||
)
|
||||
.join(", ")
|
||||
+
|
||||
"</dd>";
|
||||
}
|
||||
|
||||
!}
|
||||
</dl>
|
||||
</if>
|
||||
</if>
|
||||
|
||||
<!-- ============================== constructor details ==================== -->
|
||||
<if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
|
||||
<div class="details"><a name="constructor"> </a>
|
||||
<div class="sectionTitle">
|
||||
{+classType+}Detail
|
||||
</div>
|
||||
|
||||
<div class="fixedFont">{!
|
||||
if (data.isPrivate) output += "<private> ";
|
||||
if (data.isInner) output += "<inner> ";
|
||||
!}
|
||||
<b>{+ data.alias +}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
{+resolveLinks(data.desc)+}
|
||||
<if test="data.author"><br /><i>Author: </i>{+data.author+}.</if>
|
||||
</div>
|
||||
|
||||
<if test="data.example.length">
|
||||
<for each="example" in="data.example">
|
||||
<pre class="code">{+example+}</pre>
|
||||
</for>
|
||||
</if>
|
||||
|
||||
|
||||
<if test="data.params.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
<for each="item" in="data.params">
|
||||
<dt>
|
||||
{+((item.type)?""+("<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type)+"}</span> ")) : "")+} <b>{+item.name+}</b>
|
||||
<if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
|
||||
</dt>
|
||||
<dd>{+resolveLinks(item.desc)+}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="data.deprecated">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Deprecated:</dt>
|
||||
<dt>
|
||||
{+resolveLinks(data.deprecated)+}
|
||||
</dt>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="data.since">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Since:</dt>
|
||||
<dd>{+ data.since +}</dd>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="data.exceptions.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Throws:</dt>
|
||||
<for each="item" in="data.exceptions">
|
||||
<dt>
|
||||
{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
|
||||
</dt>
|
||||
<dd>{+resolveLinks(item.desc)+}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="data.returns.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Returns:</dt>
|
||||
<for each="item" in="data.returns">
|
||||
<dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="data.requires.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Requires:</dt>
|
||||
<for each="item" in="data.requires">
|
||||
<dd>{+ resolveLinks(item) +}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="data.see.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">See:</dt>
|
||||
<for each="item" in="data.see">
|
||||
<dd>{+ new Link().toSymbol(item) +}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
|
||||
</div>
|
||||
</if>
|
||||
|
||||
<!-- ============================== field details ========================== -->
|
||||
<if test="defined(ownProperties) && ownProperties.length">
|
||||
<div class="sectionTitle">
|
||||
Field Detail
|
||||
</div>
|
||||
<for each="member" in="ownProperties">
|
||||
<a name="{+Link.symbolNameToLinkName(member)+}"> </a>
|
||||
<div class="fixedFont">{!
|
||||
if (member.isPrivate) output += "<private> ";
|
||||
if (member.isInner) output += "<inner> ";
|
||||
if (member.isStatic) output += "<static> ";
|
||||
if (member.isConstant) output += "<constant> ";
|
||||
!}
|
||||
|
||||
<if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
|
||||
<if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
{+resolveLinks(member.desc)+}
|
||||
<if test="member.srcFile != data.srcFile">
|
||||
<br />
|
||||
<i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
|
||||
</if>
|
||||
<if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
|
||||
</div>
|
||||
|
||||
<if test="member.example.length">
|
||||
<for each="example" in="member.example">
|
||||
<pre class="code">{+example+}</pre>
|
||||
</for>
|
||||
</if>
|
||||
|
||||
<if test="member.deprecated">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Deprecated:</dt>
|
||||
<dt>
|
||||
{+ member.deprecated +}
|
||||
</dt>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.since">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Since:</dt>
|
||||
<dd>{+ member.since +}</dd>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.see.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">See:</dt>
|
||||
<for each="item" in="member.see">
|
||||
<dd>{+ new Link().toSymbol(item) +}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.defaultValue">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Default Value:</dt>
|
||||
<dd>
|
||||
{+resolveLinks(member.defaultValue)+}
|
||||
</dd>
|
||||
</dl>
|
||||
</if>
|
||||
|
||||
<if test="!$member_last"><hr /></if>
|
||||
</for>
|
||||
</if>
|
||||
|
||||
<!-- ============================== method details ========================= -->
|
||||
<if test="defined(ownMethods) && ownMethods.length">
|
||||
<div class="sectionTitle">
|
||||
Method Detail
|
||||
</div>
|
||||
<for each="member" in="ownMethods">
|
||||
<a name="{+Link.symbolNameToLinkName(member)+}"> </a>
|
||||
<div class="fixedFont">{!
|
||||
if (member.isPrivate) output += "<private> ";
|
||||
if (member.isInner) output += "<inner> ";
|
||||
if (member.isStatic) output += "<static> ";
|
||||
!}
|
||||
|
||||
<if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
|
||||
<if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>{+makeSignature(member.params)+}
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
{+resolveLinks(member.desc)+}
|
||||
<if test="member.srcFile != data.srcFile">
|
||||
<br />
|
||||
<i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
|
||||
</if>
|
||||
<if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
|
||||
</div>
|
||||
|
||||
<if test="member.example.length">
|
||||
<for each="example" in="member.example">
|
||||
<pre class="code">{+example+}</pre>
|
||||
</for>
|
||||
</if>
|
||||
|
||||
<if test="member.params.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
<for each="item" in="member.params">
|
||||
<dt>
|
||||
{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}<b>{+item.name+}</b>
|
||||
<if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
|
||||
</dt>
|
||||
<dd>{+resolveLinks(item.desc)+}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.deprecated">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Deprecated:</dt>
|
||||
<dt>
|
||||
{+member.deprecated+}
|
||||
</dt>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.since">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Since:</dt>
|
||||
<dd>{+ member.since +}</dd>
|
||||
</dl>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.exceptions.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Throws:</dt>
|
||||
<for each="item" in="member.exceptions">
|
||||
<dt>
|
||||
{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
|
||||
</dt>
|
||||
<dd>{+resolveLinks(item.desc)+}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.returns.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Returns:</dt>
|
||||
<for each="item" in="member.returns">
|
||||
<dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.requires.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Requires:</dt>
|
||||
<for each="item" in="member.requires">
|
||||
<dd>{+ resolveLinks(item) +}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.see.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">See:</dt>
|
||||
<for each="item" in="member.see">
|
||||
<dd>{+ new Link().toSymbol(item) +}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
|
||||
<if test="!$member_last"><hr /></if>
|
||||
</for>
|
||||
</if>
|
||||
|
||||
<!-- ============================== event details ========================= -->
|
||||
<if test="defined(ownEvents) && ownEvents.length">
|
||||
<div class="sectionTitle">
|
||||
Event Detail
|
||||
</div>
|
||||
<for each="member" in="ownEvents">
|
||||
<a name="event:{+Link.symbolNameToLinkName(member)+}"> </a>
|
||||
<div class="fixedFont">{!
|
||||
if (member.isPrivate) output += "<private> ";
|
||||
if (member.isInner) output += "<inner> ";
|
||||
if (member.isStatic) output += "<static> ";
|
||||
!}
|
||||
|
||||
<if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
|
||||
<if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>{+makeSignature(member.params)+}
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
{+resolveLinks(member.desc)+}
|
||||
<if test="member.srcFile != data.srcFile">
|
||||
<br />
|
||||
<i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
|
||||
</if>
|
||||
<if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
|
||||
</div>
|
||||
|
||||
<if test="member.example.length">
|
||||
<for each="example" in="member.example">
|
||||
<pre class="code">{+example+}</pre>
|
||||
</for>
|
||||
</if>
|
||||
|
||||
<if test="member.params.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
<for each="item" in="member.params">
|
||||
<dt>
|
||||
{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}<b>{+item.name+}</b>
|
||||
<if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
|
||||
</dt>
|
||||
<dd>{+resolveLinks(item.desc)+}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.deprecated">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Deprecated:</dt>
|
||||
<dt>
|
||||
{+member.deprecated+}
|
||||
</dt>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.since">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Since:</dt>
|
||||
<dd>{+ member.since +}</dd>
|
||||
</dl>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.exceptions.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Throws:</dt>
|
||||
<for each="item" in="member.exceptions">
|
||||
<dt>
|
||||
{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
|
||||
</dt>
|
||||
<dd>{+resolveLinks(item.desc)+}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.returns.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Returns:</dt>
|
||||
<for each="item" in="member.returns">
|
||||
<dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.requires.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Requires:</dt>
|
||||
<for each="item" in="member.requires">
|
||||
<dd>{+ resolveLinks(item) +}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
<if test="member.see.length">
|
||||
<dl class="detailList">
|
||||
<dt class="heading">See:</dt>
|
||||
<for each="item" in="member.see">
|
||||
<dd>{+ new Link().toSymbol(item) +}</dd>
|
||||
</for>
|
||||
</dl>
|
||||
</if>
|
||||
|
||||
<if test="!$member_last"><hr /></if>
|
||||
</for>
|
||||
</if>
|
||||
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
<if test="JSDOC.opt.D.copyright">©{+JSDOC.opt.D.copyright+}<br /></if>
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,39 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}"" />
|
||||
|
||||
<title>JsDoc Reference - Index</title>
|
||||
<meta name="generator" content="JsDoc Toolkit" />
|
||||
|
||||
<style type="text/css">
|
||||
{+include("static/default.css")+}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{+include("static/header.html")+}
|
||||
|
||||
<div id="index">
|
||||
{+publish.classesIndex+}
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<h1 class="classTitle">Class Index</h1>
|
||||
|
||||
<for each="thisClass" in="data">
|
||||
<div>
|
||||
<h2>{+(new Link().toSymbol(thisClass.alias))+}</h2>
|
||||
{+resolveLinks(summarize(thisClass.classDesc))+}
|
||||
</div>
|
||||
<hr />
|
||||
</for>
|
||||
|
||||
</div>
|
||||
<div class="fineprint" style="clear:both">
|
||||
<if test="JSDOC.opt.D.copyright">©{+JSDOC.opt.D.copyright+}<br /></if>
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,184 +0,0 @@
|
||||
/** Called automatically by JsDoc Toolkit. */
|
||||
function publish(symbolSet) {
|
||||
publish.conf = { // trailing slash expected for dirs
|
||||
ext: ".html",
|
||||
outDir: JSDOC.opt.d || SYS.pwd+"../out/jsdoc/",
|
||||
templatesDir: JSDOC.opt.t || SYS.pwd+"../templates/jsdoc/",
|
||||
symbolsDir: "symbols/",
|
||||
srcDir: "symbols/src/"
|
||||
};
|
||||
|
||||
// is source output is suppressed, just display the links to the source file
|
||||
if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) {
|
||||
Link.prototype._makeSrcLink = function(srcFilePath) {
|
||||
return "<"+srcFilePath+">";
|
||||
}
|
||||
}
|
||||
|
||||
// create the folders and subfolders to hold the output
|
||||
IO.mkPath((publish.conf.outDir+"symbols/src").split("/"));
|
||||
|
||||
// used to allow Link to check the details of things being linked to
|
||||
Link.symbolSet = symbolSet;
|
||||
|
||||
// create the required templates
|
||||
try {
|
||||
var classTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"class.tmpl");
|
||||
var classesTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allclasses.tmpl");
|
||||
}
|
||||
catch(e) {
|
||||
print("Couldn't create the required templates: "+e);
|
||||
quit();
|
||||
}
|
||||
|
||||
// some ustility filters
|
||||
function hasNoParent($) {return ($.memberOf == "")}
|
||||
function isaFile($) {return ($.is("FILE"))}
|
||||
function isaClass($) {return ($.is("CONSTRUCTOR") || $.isNamespace)}
|
||||
|
||||
// get an array version of the symbolset, useful for filtering
|
||||
var symbols = symbolSet.toArray();
|
||||
|
||||
// create the hilited source code files
|
||||
var files = JSDOC.opt.srcFiles;
|
||||
for (var i = 0, l = files.length; i < l; i++) {
|
||||
var file = files[i];
|
||||
var srcDir = publish.conf.outDir + "symbols/src/";
|
||||
makeSrcFile(file, srcDir);
|
||||
}
|
||||
|
||||
// get a list of all the classes in the symbolset
|
||||
var classes = symbols.filter(isaClass).sort(makeSortby("alias"));
|
||||
|
||||
// create a class index, displayed in the left-hand column of every class page
|
||||
Link.base = "../";
|
||||
publish.classesIndex = classesTemplate.process(classes); // kept in memory
|
||||
|
||||
// create each of the class pages
|
||||
for (var i = 0, l = classes.length; i < l; i++) {
|
||||
var symbol = classes[i];
|
||||
|
||||
symbol.events = symbol.getEvents(); // 1 order matters
|
||||
symbol.methods = symbol.getMethods(); // 2
|
||||
|
||||
var output = "";
|
||||
output = classTemplate.process(symbol);
|
||||
|
||||
IO.saveFile(publish.conf.outDir+"symbols/", symbol.alias+publish.conf.ext, output);
|
||||
}
|
||||
|
||||
// regenerate the index with different relative links, used in the index pages
|
||||
Link.base = "";
|
||||
publish.classesIndex = classesTemplate.process(classes);
|
||||
|
||||
// create the class index page
|
||||
try {
|
||||
var classesindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"index.tmpl");
|
||||
}
|
||||
catch(e) { print(e.message); quit(); }
|
||||
|
||||
var classesIndex = classesindexTemplate.process(classes);
|
||||
IO.saveFile(publish.conf.outDir, "index"+publish.conf.ext, classesIndex);
|
||||
classesindexTemplate = classesIndex = classes = null;
|
||||
|
||||
// create the file index page
|
||||
try {
|
||||
var fileindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allfiles.tmpl");
|
||||
}
|
||||
catch(e) { print(e.message); quit(); }
|
||||
|
||||
var documentedFiles = symbols.filter(isaFile); // files that have file-level docs
|
||||
var allFiles = []; // not all files have file-level docs, but we need to list every one
|
||||
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
allFiles.push(new JSDOC.Symbol(files[i], [], "FILE", new JSDOC.DocComment("/** */")));
|
||||
}
|
||||
|
||||
for (var i = 0; i < documentedFiles.length; i++) {
|
||||
var offset = files.indexOf(documentedFiles[i].alias);
|
||||
allFiles[offset] = documentedFiles[i];
|
||||
}
|
||||
|
||||
allFiles = allFiles.sort(makeSortby("name"));
|
||||
|
||||
// output the file index page
|
||||
var filesIndex = fileindexTemplate.process(allFiles);
|
||||
IO.saveFile(publish.conf.outDir, "files"+publish.conf.ext, filesIndex);
|
||||
fileindexTemplate = filesIndex = files = null;
|
||||
}
|
||||
|
||||
|
||||
/** Just the first sentence (up to a full stop). Should not break on dotted variable names. */
|
||||
function summarize(desc) {
|
||||
if (typeof desc != "undefined")
|
||||
return desc.match(/([\w\W]+?\.)[^a-z0-9_$]/i)? RegExp.$1 : desc;
|
||||
}
|
||||
|
||||
/** Make a symbol sorter by some attribute. */
|
||||
function makeSortby(attribute) {
|
||||
return function(a, b) {
|
||||
if (a[attribute] != undefined && b[attribute] != undefined) {
|
||||
a = a[attribute].toLowerCase();
|
||||
b = b[attribute].toLowerCase();
|
||||
if (a < b) return -1;
|
||||
if (a > b) return 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Pull in the contents of an external file at the given path. */
|
||||
function include(path) {
|
||||
var path = publish.conf.templatesDir+path;
|
||||
return IO.readFile(path);
|
||||
}
|
||||
|
||||
/** Turn a raw source file into a code-hilited page in the docs. */
|
||||
function makeSrcFile(path, srcDir, name) {
|
||||
if (JSDOC.opt.s) return;
|
||||
|
||||
if (!name) {
|
||||
name = path.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_");
|
||||
name = name.replace(/\:/g, "_");
|
||||
}
|
||||
|
||||
var src = {path: path, name:name, charset: IO.encoding, hilited: ""};
|
||||
|
||||
if (defined(JSDOC.PluginManager)) {
|
||||
JSDOC.PluginManager.run("onPublishSrc", src);
|
||||
}
|
||||
|
||||
if (src.hilited) {
|
||||
IO.saveFile(srcDir, name+publish.conf.ext, src.hilited);
|
||||
}
|
||||
}
|
||||
|
||||
/** Build output for displaying function parameters. */
|
||||
function makeSignature(params) {
|
||||
if (!params) return "()";
|
||||
var signature = "("
|
||||
+
|
||||
params.filter(
|
||||
function($) {
|
||||
return $.name.indexOf(".") == -1; // don't show config params in signature
|
||||
}
|
||||
).map(
|
||||
function($) {
|
||||
return $.name;
|
||||
}
|
||||
).join(", ")
|
||||
+
|
||||
")";
|
||||
return signature;
|
||||
}
|
||||
|
||||
/** Find symbol {@link ...} strings in text and turn into html links */
|
||||
function resolveLinks(str, from) {
|
||||
str = str.replace(/\{@link ([^} ]+) ?\}/gi,
|
||||
function(match, symbolName) {
|
||||
return new Link().toSymbol(symbolName);
|
||||
}
|
||||
);
|
||||
|
||||
return str;
|
||||
}
|
||||
@@ -1,162 +0,0 @@
|
||||
/* default.css */
|
||||
body
|
||||
{
|
||||
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
.header
|
||||
{
|
||||
clear: both;
|
||||
background-color: #ccc;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
h1
|
||||
{
|
||||
font-size: 150%;
|
||||
font-weight: bold;
|
||||
padding: 0;
|
||||
margin: 1em 0 0 .3em;
|
||||
}
|
||||
|
||||
hr
|
||||
{
|
||||
border: none 0;
|
||||
border-top: 1px solid #7F8FB1;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
pre.code
|
||||
{
|
||||
display: block;
|
||||
padding: 8px;
|
||||
border: 1px dashed #ccc;
|
||||
}
|
||||
|
||||
#index
|
||||
{
|
||||
margin-top: 24px;
|
||||
float: left;
|
||||
width: 160px;
|
||||
position: absolute;
|
||||
left: 8px;
|
||||
background-color: #F3F3F3;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#content
|
||||
{
|
||||
margin-left: 190px;
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.classList
|
||||
{
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0 0 0 8px;
|
||||
font-family: arial, sans-serif;
|
||||
font-size: 1em;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.classList li
|
||||
{
|
||||
padding: 0;
|
||||
margin: 0 0 8px 0;
|
||||
}
|
||||
|
||||
.summaryTable { width: 100%; }
|
||||
|
||||
h1.classTitle
|
||||
{
|
||||
font-size:170%;
|
||||
line-height:130%;
|
||||
}
|
||||
|
||||
h2 { font-size: 110%; }
|
||||
caption, div.sectionTitle
|
||||
{
|
||||
background-color: #7F8FB1;
|
||||
color: #fff;
|
||||
font-size:130%;
|
||||
text-align: left;
|
||||
padding: 2px 6px 2px 6px;
|
||||
border: 1px #7F8FB1 solid;
|
||||
}
|
||||
|
||||
div.sectionTitle { margin-bottom: 8px; }
|
||||
.summaryTable thead { display: none; }
|
||||
|
||||
.summaryTable td
|
||||
{
|
||||
vertical-align: top;
|
||||
padding: 4px;
|
||||
border-bottom: 1px #7F8FB1 solid;
|
||||
border-right: 1px #7F8FB1 solid;
|
||||
}
|
||||
|
||||
/*col#summaryAttributes {}*/
|
||||
.summaryTable td.attributes
|
||||
{
|
||||
border-left: 1px #7F8FB1 solid;
|
||||
width: 140px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
td.attributes, .fixedFont
|
||||
{
|
||||
line-height: 15px;
|
||||
color: #002EBE;
|
||||
font-family: "Courier New",Courier,monospace;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.summaryTable td.nameDescription
|
||||
{
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
.summaryTable td.nameDescription, .description
|
||||
{
|
||||
line-height: 15px;
|
||||
padding: 4px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.summaryTable { margin-bottom: 8px; }
|
||||
|
||||
ul.inheritsList
|
||||
{
|
||||
list-style: square;
|
||||
margin-left: 20px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.detailList {
|
||||
margin-left: 20px;
|
||||
line-height: 15px;
|
||||
}
|
||||
.detailList dt { margin-left: 20px; }
|
||||
|
||||
.detailList .heading
|
||||
{
|
||||
font-weight: bold;
|
||||
padding-bottom: 6px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.light, td.attributes, .light a:link, .light a:visited
|
||||
{
|
||||
color: #777;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.fineprint
|
||||
{
|
||||
text-align: right;
|
||||
font-size: 10px;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
<div id="header">
|
||||
</div>
|
||||
@@ -1,19 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title>Generated Javascript Documentation</title>
|
||||
</head>
|
||||
<frameset cols="20%,80%">
|
||||
<frame src="allclasses-frame.html" name="packageFrame" />
|
||||
<frame src="splash.html" name="classFrame" />
|
||||
<noframes>
|
||||
<body>
|
||||
<p>
|
||||
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
|
||||
</p>
|
||||
</body>
|
||||
</noframes>
|
||||
</frameset>
|
||||
</html>
|
||||
@@ -1,35 +0,0 @@
|
||||
<symbol alias="{+data.alias+}">
|
||||
<name>{+data.name+}</name>
|
||||
<memberOf>{+data.memberOf+}</memberOf>
|
||||
<isStatic>{+data.isStatic+}</isStatic>
|
||||
<isa>{+data.isa+}</isa>
|
||||
<desc>{+data.desc+}</desc>
|
||||
<classDesc>{+data.classDesc+}</classDesc>
|
||||
|
||||
<methods><for each="method" in="data.methods">
|
||||
<method>
|
||||
<name>{+method.name+}</name>
|
||||
<memberOf>{+method.memberOf+}</memberOf>
|
||||
<isStatic>{+method.isStatic+}</isStatic>
|
||||
<desc>{+method.desc+}</desc>
|
||||
<params><for each="param" in="method.params">
|
||||
<param>
|
||||
<type>{+param.type+}</type>
|
||||
<name>{+param.name+}</name>
|
||||
<desc>{+param.desc+}</desc>
|
||||
<defaultValue>{+param.defaultValue+}</defaultValue>
|
||||
</param></for>
|
||||
</params>
|
||||
</method></for>
|
||||
</methods>
|
||||
|
||||
<properties><for each="property" in="data.properties">
|
||||
<property>
|
||||
<name>{+property.name+}</name>
|
||||
<memberOf>{+property.memberOf+}</memberOf>
|
||||
<isStatic>{+property.isStatic+}</isStatic>
|
||||
<desc>{+property.desc+}</desc>
|
||||
<type>{+property.type+}</type>
|
||||
</property></for>
|
||||
</properties>
|
||||
</symbol>
|
||||
5919
jshint/jshint.js
5919
jshint/jshint.js
File diff suppressed because it is too large
Load Diff
@@ -1,99 +0,0 @@
|
||||
var fs = require("fs");
|
||||
var sys = require("sys");
|
||||
var path = require("path");
|
||||
var JSHINT = require("./jshint").JSHINT;
|
||||
|
||||
// DWF TODO: Standardize this?
|
||||
function isExcluded(fullPath) {
|
||||
var fileName = path.basename(fullPath);
|
||||
var excludeFiles = ["json2.js", "jshint.js", "publish.js", "node_suite.js", "jasmine.js", "jasmine-html.js"];
|
||||
for (var i = 0; i < excludeFiles.length; i++) {
|
||||
if (fileName == excludeFiles[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// DWF TODO: This function could/should be re-written
|
||||
function allJasmineJsFiles(rootDir) {
|
||||
var files = [];
|
||||
fs.readdirSync(rootDir).filter(function(filename) {
|
||||
|
||||
var fullPath = rootDir + "/" + filename;
|
||||
if (fs.statSync(fullPath).isDirectory() && !fullPath.match(/pages/)) {
|
||||
var subDirFiles = allJasmineJsFiles(fullPath);
|
||||
if (subDirFiles.length > 0) {
|
||||
files = files.concat();
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (fullPath.match(/\.js$/) && !isExcluded(fullPath)) {
|
||||
files.push(fullPath);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
var jasmineJsFiles = allJasmineJsFiles(".");
|
||||
jasmineJsFiles.reverse(); //cheap way to do the stuff in src stuff first
|
||||
|
||||
var jasmineJsHintConfig = {
|
||||
|
||||
forin:true, //while it's possible that we could be
|
||||
//considering unwanted prototype methods, mostly
|
||||
//we're doing this because the jsobjects are being
|
||||
//used as maps.
|
||||
|
||||
loopfunc:true //we're fine with functions defined inside loops (setTimeout functions, etc)
|
||||
|
||||
};
|
||||
|
||||
var jasmineGlobals = {};
|
||||
|
||||
|
||||
//jasmine.undefined is a jasmine-ism, let's let it go...
|
||||
function removeJasmineUndefinedErrors(errors) {
|
||||
var keepErrors = [];
|
||||
for (var i = 0; i < errors.length; i++) {
|
||||
if (!(errors[i] &&
|
||||
errors[i].raw &&
|
||||
errors[i].evidence &&
|
||||
( errors[i].evidence.match(/jasmine\.undefined/) ||
|
||||
errors[i].evidence.match(/diz be undefined yo/) )
|
||||
)) {
|
||||
keepErrors.push(errors[i]);
|
||||
}
|
||||
}
|
||||
return keepErrors;
|
||||
}
|
||||
|
||||
(function() {
|
||||
var ansi = {
|
||||
green: '\033[32m',
|
||||
red: '\033[31m',
|
||||
yellow: '\033[33m',
|
||||
none: '\033[0m'
|
||||
};
|
||||
|
||||
for (var i = 0; i < jasmineJsFiles.length; i++) {
|
||||
var file = jasmineJsFiles[i];
|
||||
JSHINT(fs.readFileSync(file, "utf8"), jasmineJsHintConfig);
|
||||
var errors = JSHINT.data().errors || [];
|
||||
errors = removeJasmineUndefinedErrors(errors);
|
||||
|
||||
if (errors.length >= 1) {
|
||||
console.log(ansi.red + "Jasmine JSHint failure: " + ansi.none);
|
||||
console.log(file);
|
||||
console.log(errors);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(ansi.green + "Jasmine JSHint PASSED." + ansi.none);
|
||||
})();
|
||||
|
||||
190
lib/console/console.js
Normal file
190
lib/console/console.js
Normal file
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
Copyright (c) 2008-2017 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
function getJasmineRequireObj() {
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
return exports;
|
||||
} else {
|
||||
window.jasmineRequire = window.jasmineRequire || {};
|
||||
return window.jasmineRequire;
|
||||
}
|
||||
}
|
||||
|
||||
getJasmineRequireObj().console = function(jRequire, j$) {
|
||||
j$.ConsoleReporter = jRequire.ConsoleReporter();
|
||||
};
|
||||
|
||||
getJasmineRequireObj().ConsoleReporter = function() {
|
||||
|
||||
var noopTimer = {
|
||||
start: function(){},
|
||||
elapsed: function(){ return 0; }
|
||||
};
|
||||
|
||||
function ConsoleReporter(options) {
|
||||
var print = options.print,
|
||||
showColors = options.showColors || false,
|
||||
onComplete = options.onComplete || function() {},
|
||||
timer = options.timer || noopTimer,
|
||||
specCount,
|
||||
failureCount,
|
||||
failedSpecs = [],
|
||||
pendingCount,
|
||||
ansi = {
|
||||
green: '\x1B[32m',
|
||||
red: '\x1B[31m',
|
||||
yellow: '\x1B[33m',
|
||||
none: '\x1B[0m'
|
||||
},
|
||||
failedSuites = [];
|
||||
|
||||
print('ConsoleReporter is deprecated and will be removed in a future version.');
|
||||
|
||||
this.jasmineStarted = function() {
|
||||
specCount = 0;
|
||||
failureCount = 0;
|
||||
pendingCount = 0;
|
||||
print('Started');
|
||||
printNewline();
|
||||
timer.start();
|
||||
};
|
||||
|
||||
this.jasmineDone = function() {
|
||||
printNewline();
|
||||
for (var i = 0; i < failedSpecs.length; i++) {
|
||||
specFailureDetails(failedSpecs[i]);
|
||||
}
|
||||
|
||||
if(specCount > 0) {
|
||||
printNewline();
|
||||
|
||||
var specCounts = specCount + ' ' + plural('spec', specCount) + ', ' +
|
||||
failureCount + ' ' + plural('failure', failureCount);
|
||||
|
||||
if (pendingCount) {
|
||||
specCounts += ', ' + pendingCount + ' pending ' + plural('spec', pendingCount);
|
||||
}
|
||||
|
||||
print(specCounts);
|
||||
} else {
|
||||
print('No specs found');
|
||||
}
|
||||
|
||||
printNewline();
|
||||
var seconds = timer.elapsed() / 1000;
|
||||
print('Finished in ' + seconds + ' ' + plural('second', seconds));
|
||||
printNewline();
|
||||
|
||||
for(i = 0; i < failedSuites.length; i++) {
|
||||
suiteFailureDetails(failedSuites[i]);
|
||||
}
|
||||
|
||||
onComplete(failureCount === 0);
|
||||
};
|
||||
|
||||
this.specDone = function(result) {
|
||||
specCount++;
|
||||
|
||||
if (result.status == 'pending') {
|
||||
pendingCount++;
|
||||
print(colored('yellow', '*'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.status == 'passed') {
|
||||
print(colored('green', '.'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.status == 'failed') {
|
||||
failureCount++;
|
||||
failedSpecs.push(result);
|
||||
print(colored('red', 'F'));
|
||||
}
|
||||
};
|
||||
|
||||
this.suiteDone = function(result) {
|
||||
if (result.failedExpectations && result.failedExpectations.length > 0) {
|
||||
failureCount++;
|
||||
failedSuites.push(result);
|
||||
}
|
||||
};
|
||||
|
||||
return this;
|
||||
|
||||
function printNewline() {
|
||||
print('\n');
|
||||
}
|
||||
|
||||
function colored(color, str) {
|
||||
return showColors ? (ansi[color] + str + ansi.none) : str;
|
||||
}
|
||||
|
||||
function plural(str, count) {
|
||||
return count == 1 ? str : str + 's';
|
||||
}
|
||||
|
||||
function repeat(thing, times) {
|
||||
var arr = [];
|
||||
for (var i = 0; i < times; i++) {
|
||||
arr.push(thing);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
function indent(str, spaces) {
|
||||
var lines = (str || '').split('\n');
|
||||
var newArr = [];
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
newArr.push(repeat(' ', spaces).join('') + lines[i]);
|
||||
}
|
||||
return newArr.join('\n');
|
||||
}
|
||||
|
||||
function specFailureDetails(result) {
|
||||
printNewline();
|
||||
print(result.fullName);
|
||||
|
||||
for (var i = 0; i < result.failedExpectations.length; i++) {
|
||||
var failedExpectation = result.failedExpectations[i];
|
||||
printNewline();
|
||||
print(indent(failedExpectation.message, 2));
|
||||
print(indent(failedExpectation.stack, 2));
|
||||
}
|
||||
|
||||
printNewline();
|
||||
}
|
||||
|
||||
function suiteFailureDetails(result) {
|
||||
for (var i = 0; i < result.failedExpectations.length; i++) {
|
||||
printNewline();
|
||||
print(colored('red', 'An error was thrown in an afterAll'));
|
||||
printNewline();
|
||||
print(colored('red', 'AfterAll ' + result.failedExpectations[i].message));
|
||||
|
||||
}
|
||||
printNewline();
|
||||
}
|
||||
}
|
||||
|
||||
return ConsoleReporter;
|
||||
};
|
||||
37
lib/jasmine-core.js
Normal file
37
lib/jasmine-core.js
Normal file
@@ -0,0 +1,37 @@
|
||||
module.exports = require("./jasmine-core/jasmine.js");
|
||||
module.exports.boot = require('./jasmine-core/node_boot.js');
|
||||
|
||||
var path = require('path'),
|
||||
fs = require('fs');
|
||||
|
||||
var rootPath = path.join(__dirname, "jasmine-core"),
|
||||
bootFiles = ['boot.js'],
|
||||
nodeBootFiles = ['node_boot.js'],
|
||||
cssFiles = [],
|
||||
jsFiles = [],
|
||||
jsFilesToSkip = ['jasmine.js'].concat(bootFiles, nodeBootFiles);
|
||||
|
||||
fs.readdirSync(rootPath).forEach(function(file) {
|
||||
if(fs.statSync(path.join(rootPath, file)).isFile()) {
|
||||
switch(path.extname(file)) {
|
||||
case '.css':
|
||||
cssFiles.push(file);
|
||||
break;
|
||||
case '.js':
|
||||
if (jsFilesToSkip.indexOf(file) < 0) {
|
||||
jsFiles.push(file);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
module.exports.files = {
|
||||
path: rootPath,
|
||||
bootDir: rootPath,
|
||||
bootFiles: bootFiles,
|
||||
nodeBootFiles: nodeBootFiles,
|
||||
cssFiles: cssFiles,
|
||||
jsFiles: ['jasmine.js'].concat(jsFiles),
|
||||
imagesDir: path.join(__dirname, '../images')
|
||||
};
|
||||
@@ -6,7 +6,7 @@ module Jasmine
|
||||
end
|
||||
|
||||
def js_files
|
||||
(["jasmine.js"] + Dir.glob(File.join(path, "*.js"))).map { |f| File.basename(f) }.uniq
|
||||
(["jasmine.js"] + Dir.glob(File.join(path, "*.js"))).map { |f| File.basename(f) }.uniq - boot_files - node_boot_files
|
||||
end
|
||||
|
||||
SPEC_TYPES = ["core", "html", "node"]
|
||||
@@ -23,6 +23,18 @@ module Jasmine
|
||||
spec_files("node")
|
||||
end
|
||||
|
||||
def boot_files
|
||||
["boot.js"]
|
||||
end
|
||||
|
||||
def node_boot_files
|
||||
["node_boot.js"]
|
||||
end
|
||||
|
||||
def boot_dir
|
||||
path
|
||||
end
|
||||
|
||||
def spec_files(type)
|
||||
raise ArgumentError.new("Unrecognized spec type") unless SPEC_TYPES.include?(type)
|
||||
(Dir.glob(File.join(path, "spec", type, "*.js"))).map { |f| File.join("spec", type, File.basename(f)) }.uniq
|
||||
@@ -31,6 +43,11 @@ module Jasmine
|
||||
def css_files
|
||||
Dir.glob(File.join(path, "*.css")).map { |f| File.basename(f) }
|
||||
end
|
||||
|
||||
def images_dir
|
||||
File.join(File.dirname(__FILE__), '../images')
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
1
lib/jasmine-core/__init__.py
Normal file
1
lib/jasmine-core/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .core import Core
|
||||
155
lib/jasmine-core/boot.js
Normal file
155
lib/jasmine-core/boot.js
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
Copyright (c) 2008-2017 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
|
||||
|
||||
If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
|
||||
|
||||
The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
|
||||
|
||||
[jasmine-gem]: http://github.com/pivotal/jasmine-gem
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
/**
|
||||
* ## Require & Instantiate
|
||||
*
|
||||
* Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
|
||||
*/
|
||||
window.jasmine = jasmineRequire.core(jasmineRequire);
|
||||
|
||||
/**
|
||||
* Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
|
||||
*/
|
||||
jasmineRequire.html(jasmine);
|
||||
|
||||
/**
|
||||
* Create the Jasmine environment. This is used to run all specs in a project.
|
||||
*/
|
||||
var env = jasmine.getEnv();
|
||||
|
||||
/**
|
||||
* ## The Global Interface
|
||||
*
|
||||
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
|
||||
*/
|
||||
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||
|
||||
/**
|
||||
* Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
|
||||
*/
|
||||
extend(window, jasmineInterface);
|
||||
|
||||
/**
|
||||
* ## Runner Parameters
|
||||
*
|
||||
* More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
|
||||
*/
|
||||
|
||||
var queryString = new jasmine.QueryString({
|
||||
getWindowLocation: function() { return window.location; }
|
||||
});
|
||||
|
||||
var filterSpecs = !!queryString.getParam("spec");
|
||||
|
||||
var catchingExceptions = queryString.getParam("catch");
|
||||
env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);
|
||||
|
||||
var throwingExpectationFailures = queryString.getParam("throwFailures");
|
||||
env.throwOnExpectationFailure(throwingExpectationFailures);
|
||||
|
||||
var random = queryString.getParam("random");
|
||||
env.randomizeTests(random);
|
||||
|
||||
var seed = queryString.getParam("seed");
|
||||
if (seed) {
|
||||
env.seed(seed);
|
||||
}
|
||||
|
||||
/**
|
||||
* ## Reporters
|
||||
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
|
||||
*/
|
||||
var htmlReporter = new jasmine.HtmlReporter({
|
||||
env: env,
|
||||
onRaiseExceptionsClick: function() { queryString.navigateWithNewParam("catch", !env.catchingExceptions()); },
|
||||
onThrowExpectationsClick: function() { queryString.navigateWithNewParam("throwFailures", !env.throwingExpectationFailures()); },
|
||||
onRandomClick: function() { queryString.navigateWithNewParam("random", !env.randomTests()); },
|
||||
addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
|
||||
getContainer: function() { return document.body; },
|
||||
createElement: function() { return document.createElement.apply(document, arguments); },
|
||||
createTextNode: function() { return document.createTextNode.apply(document, arguments); },
|
||||
timer: new jasmine.Timer(),
|
||||
filterSpecs: filterSpecs
|
||||
});
|
||||
|
||||
/**
|
||||
* The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
|
||||
*/
|
||||
env.addReporter(jasmineInterface.jsApiReporter);
|
||||
env.addReporter(htmlReporter);
|
||||
|
||||
/**
|
||||
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
|
||||
*/
|
||||
var specFilter = new jasmine.HtmlSpecFilter({
|
||||
filterString: function() { return queryString.getParam("spec"); }
|
||||
});
|
||||
|
||||
env.specFilter = function(spec) {
|
||||
return specFilter.matches(spec.getFullName());
|
||||
};
|
||||
|
||||
/**
|
||||
* Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
|
||||
*/
|
||||
window.setTimeout = window.setTimeout;
|
||||
window.setInterval = window.setInterval;
|
||||
window.clearTimeout = window.clearTimeout;
|
||||
window.clearInterval = window.clearInterval;
|
||||
|
||||
/**
|
||||
* ## Execution
|
||||
*
|
||||
* Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
|
||||
*/
|
||||
var currentWindowOnload = window.onload;
|
||||
|
||||
window.onload = function() {
|
||||
if (currentWindowOnload) {
|
||||
currentWindowOnload();
|
||||
}
|
||||
htmlReporter.initialize();
|
||||
env.execute();
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper function for readability above.
|
||||
*/
|
||||
function extend(destination, source) {
|
||||
for (var property in source) destination[property] = source[property];
|
||||
return destination;
|
||||
}
|
||||
|
||||
}());
|
||||
133
lib/jasmine-core/boot/boot.js
Normal file
133
lib/jasmine-core/boot/boot.js
Normal file
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
|
||||
|
||||
If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
|
||||
|
||||
The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
|
||||
|
||||
[jasmine-gem]: http://github.com/pivotal/jasmine-gem
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
/**
|
||||
* ## Require & Instantiate
|
||||
*
|
||||
* Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
|
||||
*/
|
||||
window.jasmine = jasmineRequire.core(jasmineRequire);
|
||||
|
||||
/**
|
||||
* Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
|
||||
*/
|
||||
jasmineRequire.html(jasmine);
|
||||
|
||||
/**
|
||||
* Create the Jasmine environment. This is used to run all specs in a project.
|
||||
*/
|
||||
var env = jasmine.getEnv();
|
||||
|
||||
/**
|
||||
* ## The Global Interface
|
||||
*
|
||||
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
|
||||
*/
|
||||
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||
|
||||
/**
|
||||
* Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
|
||||
*/
|
||||
extend(window, jasmineInterface);
|
||||
|
||||
/**
|
||||
* ## Runner Parameters
|
||||
*
|
||||
* More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
|
||||
*/
|
||||
|
||||
var queryString = new jasmine.QueryString({
|
||||
getWindowLocation: function() { return window.location; }
|
||||
});
|
||||
|
||||
var filterSpecs = !!queryString.getParam("spec");
|
||||
|
||||
var catchingExceptions = queryString.getParam("catch");
|
||||
env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);
|
||||
|
||||
var throwingExpectationFailures = queryString.getParam("throwFailures");
|
||||
env.throwOnExpectationFailure(throwingExpectationFailures);
|
||||
|
||||
var random = queryString.getParam("random");
|
||||
env.randomizeTests(random);
|
||||
|
||||
var seed = queryString.getParam("seed");
|
||||
if (seed) {
|
||||
env.seed(seed);
|
||||
}
|
||||
|
||||
/**
|
||||
* ## Reporters
|
||||
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
|
||||
*/
|
||||
var htmlReporter = new jasmine.HtmlReporter({
|
||||
env: env,
|
||||
onRaiseExceptionsClick: function() { queryString.navigateWithNewParam("catch", !env.catchingExceptions()); },
|
||||
onThrowExpectationsClick: function() { queryString.navigateWithNewParam("throwFailures", !env.throwingExpectationFailures()); },
|
||||
onRandomClick: function() { queryString.navigateWithNewParam("random", !env.randomTests()); },
|
||||
addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
|
||||
getContainer: function() { return document.body; },
|
||||
createElement: function() { return document.createElement.apply(document, arguments); },
|
||||
createTextNode: function() { return document.createTextNode.apply(document, arguments); },
|
||||
timer: new jasmine.Timer(),
|
||||
filterSpecs: filterSpecs
|
||||
});
|
||||
|
||||
/**
|
||||
* The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
|
||||
*/
|
||||
env.addReporter(jasmineInterface.jsApiReporter);
|
||||
env.addReporter(htmlReporter);
|
||||
|
||||
/**
|
||||
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
|
||||
*/
|
||||
var specFilter = new jasmine.HtmlSpecFilter({
|
||||
filterString: function() { return queryString.getParam("spec"); }
|
||||
});
|
||||
|
||||
env.specFilter = function(spec) {
|
||||
return specFilter.matches(spec.getFullName());
|
||||
};
|
||||
|
||||
/**
|
||||
* Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
|
||||
*/
|
||||
window.setTimeout = window.setTimeout;
|
||||
window.setInterval = window.setInterval;
|
||||
window.clearTimeout = window.clearTimeout;
|
||||
window.clearInterval = window.clearInterval;
|
||||
|
||||
/**
|
||||
* ## Execution
|
||||
*
|
||||
* Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
|
||||
*/
|
||||
var currentWindowOnload = window.onload;
|
||||
|
||||
window.onload = function() {
|
||||
if (currentWindowOnload) {
|
||||
currentWindowOnload();
|
||||
}
|
||||
htmlReporter.initialize();
|
||||
env.execute();
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper function for readability above.
|
||||
*/
|
||||
function extend(destination, source) {
|
||||
for (var property in source) destination[property] = source[property];
|
||||
return destination;
|
||||
}
|
||||
|
||||
}());
|
||||
19
lib/jasmine-core/boot/node_boot.js
Normal file
19
lib/jasmine-core/boot/node_boot.js
Normal file
@@ -0,0 +1,19 @@
|
||||
module.exports = function(jasmineRequire) {
|
||||
var jasmine = jasmineRequire.core(jasmineRequire);
|
||||
|
||||
var consoleFns = require('../console/console.js');
|
||||
consoleFns.console(consoleFns, jasmine);
|
||||
|
||||
var env = jasmine.getEnv();
|
||||
|
||||
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||
|
||||
extend(global, jasmineInterface);
|
||||
|
||||
function extend(destination, source) {
|
||||
for (var property in source) destination[property] = source[property];
|
||||
return destination;
|
||||
}
|
||||
|
||||
return jasmine;
|
||||
};
|
||||
60
lib/jasmine-core/core.py
Normal file
60
lib/jasmine-core/core.py
Normal file
@@ -0,0 +1,60 @@
|
||||
import pkg_resources
|
||||
|
||||
try:
|
||||
from collections import OrderedDict
|
||||
except ImportError:
|
||||
from ordereddict import OrderedDict
|
||||
|
||||
class Core(object):
|
||||
@classmethod
|
||||
def js_package(cls):
|
||||
return __package__
|
||||
|
||||
@classmethod
|
||||
def css_package(cls):
|
||||
return __package__
|
||||
|
||||
@classmethod
|
||||
def image_package(cls):
|
||||
return __package__ + ".images"
|
||||
|
||||
@classmethod
|
||||
def js_files(cls):
|
||||
js_files = sorted(list(filter(lambda x: '.js' in x, pkg_resources.resource_listdir(cls.js_package(), '.'))))
|
||||
|
||||
# jasmine.js needs to be first
|
||||
js_files.insert(0, 'jasmine.js')
|
||||
|
||||
# boot needs to be last
|
||||
js_files.remove('boot.js')
|
||||
js_files.append('boot.js')
|
||||
|
||||
return cls._uniq(js_files)
|
||||
|
||||
@classmethod
|
||||
def css_files(cls):
|
||||
return cls._uniq(sorted(filter(lambda x: '.css' in x, pkg_resources.resource_listdir(cls.css_package(), '.'))))
|
||||
|
||||
@classmethod
|
||||
def favicon(cls):
|
||||
return 'jasmine_favicon.png'
|
||||
|
||||
@classmethod
|
||||
def _uniq(self, items, idfun=None):
|
||||
# order preserving
|
||||
|
||||
if idfun is None:
|
||||
def idfun(x): return x
|
||||
seen = {}
|
||||
result = []
|
||||
for item in items:
|
||||
marker = idfun(item)
|
||||
# in old Python versions:
|
||||
# if seen.has_key(marker)
|
||||
# but in new ones:
|
||||
if marker in seen:
|
||||
continue
|
||||
|
||||
seen[marker] = 1
|
||||
result.append(item)
|
||||
return result
|
||||
@@ -1,54 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Jasmine Spec Runner</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="lib/jasmine-1.1.0.rc1/jasmine_favicon.png">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.1.0.rc1/jasmine.css">
|
||||
<script type="text/javascript" src="lib/jasmine-1.1.0.rc1/jasmine.js"></script>
|
||||
<script type="text/javascript" src="lib/jasmine-1.1.0.rc1/jasmine-html.js"></script>
|
||||
|
||||
<!-- include source files here... -->
|
||||
<script type="text/javascript" src="spec/SpecHelper.js"></script>
|
||||
<script type="text/javascript" src="spec/PlayerSpec.js"></script>
|
||||
|
||||
<!-- include spec files here... -->
|
||||
<script type="text/javascript" src="src/Player.js"></script>
|
||||
<script type="text/javascript" src="src/Song.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var jasmineEnv = jasmine.getEnv();
|
||||
jasmineEnv.updateInterval = 1000;
|
||||
|
||||
var trivialReporter = new jasmine.TrivialReporter();
|
||||
|
||||
jasmineEnv.addReporter(trivialReporter);
|
||||
|
||||
jasmineEnv.specFilter = function(spec) {
|
||||
return trivialReporter.specFilter(spec);
|
||||
};
|
||||
|
||||
var currentWindowOnload = window.onload;
|
||||
|
||||
window.onload = function() {
|
||||
if (currentWindowOnload) {
|
||||
currentWindowOnload();
|
||||
}
|
||||
execJasmine();
|
||||
};
|
||||
|
||||
function execJasmine() {
|
||||
jasmineEnv.execute();
|
||||
}
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
function Player() {
|
||||
}
|
||||
Player.prototype.play = function(song) {
|
||||
this.currentlyPlayingSong = song;
|
||||
this.isPlaying = true;
|
||||
};
|
||||
|
||||
Player.prototype.pause = function() {
|
||||
this.isPlaying = false;
|
||||
};
|
||||
|
||||
Player.prototype.resume = function() {
|
||||
if (this.isPlaying) {
|
||||
throw new Error("song is already playing");
|
||||
}
|
||||
|
||||
this.isPlaying = true;
|
||||
};
|
||||
|
||||
Player.prototype.makeFavorite = function() {
|
||||
this.currentlyPlayingSong.persistFavoriteStatus(true);
|
||||
};
|
||||
|
||||
module.exports = Player;
|
||||
@@ -0,0 +1,9 @@
|
||||
function Song() {
|
||||
}
|
||||
|
||||
Song.prototype.persistFavoriteStatus = function(value) {
|
||||
// something complicated
|
||||
throw new Error("not yet implemented");
|
||||
};
|
||||
|
||||
module.exports = Song;
|
||||
@@ -0,0 +1,15 @@
|
||||
beforeEach(function () {
|
||||
jasmine.addMatchers({
|
||||
toBePlaying: function () {
|
||||
return {
|
||||
compare: function (actual, expected) {
|
||||
var player = actual;
|
||||
|
||||
return {
|
||||
pass: player.currentlyPlayingSong === expected && player.isPlaying
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,60 @@
|
||||
describe("Player", function() {
|
||||
var Player = require('../../lib/jasmine_examples/Player');
|
||||
var Song = require('../../lib/jasmine_examples/Song');
|
||||
var player;
|
||||
var song;
|
||||
|
||||
beforeEach(function() {
|
||||
player = new Player();
|
||||
song = new Song();
|
||||
});
|
||||
|
||||
it("should be able to play a Song", function() {
|
||||
player.play(song);
|
||||
expect(player.currentlyPlayingSong).toEqual(song);
|
||||
|
||||
//demonstrates use of custom matcher
|
||||
expect(player).toBePlaying(song);
|
||||
});
|
||||
|
||||
describe("when song has been paused", function() {
|
||||
beforeEach(function() {
|
||||
player.play(song);
|
||||
player.pause();
|
||||
});
|
||||
|
||||
it("should indicate that the song is currently paused", function() {
|
||||
expect(player.isPlaying).toBeFalsy();
|
||||
|
||||
// demonstrates use of 'not' with a custom matcher
|
||||
expect(player).not.toBePlaying(song);
|
||||
});
|
||||
|
||||
it("should be possible to resume", function() {
|
||||
player.resume();
|
||||
expect(player.isPlaying).toBeTruthy();
|
||||
expect(player.currentlyPlayingSong).toEqual(song);
|
||||
});
|
||||
});
|
||||
|
||||
// demonstrates use of spies to intercept and test method calls
|
||||
it("tells the current song if the user has made it a favorite", function() {
|
||||
spyOn(song, 'persistFavoriteStatus');
|
||||
|
||||
player.play(song);
|
||||
player.makeFavorite();
|
||||
|
||||
expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true);
|
||||
});
|
||||
|
||||
//demonstrates use of expected exceptions
|
||||
describe("#resume", function() {
|
||||
it("should throw an exception if song is already playing", function() {
|
||||
player.play(song);
|
||||
|
||||
expect(function() {
|
||||
player.resume();
|
||||
}).toThrowError("song is already playing");
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -52,7 +52,7 @@ describe("Player", function() {
|
||||
|
||||
expect(function() {
|
||||
player.resume();
|
||||
}).toThrow("song is already playing");
|
||||
}).toThrowError("song is already playing");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
beforeEach(function() {
|
||||
this.addMatchers({
|
||||
toBePlaying: function(expectedSong) {
|
||||
var player = this.actual;
|
||||
return player.currentlyPlayingSong === expectedSong &&
|
||||
player.isPlaying;
|
||||
beforeEach(function () {
|
||||
jasmine.addMatchers({
|
||||
toBePlaying: function () {
|
||||
return {
|
||||
compare: function (actual, expected) {
|
||||
var player = actual;
|
||||
|
||||
return {
|
||||
pass: player.currentlyPlayingSong === expected && player.isPlaying
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,190 +1,499 @@
|
||||
jasmine.TrivialReporter = function(doc) {
|
||||
this.document = doc || document;
|
||||
this.suiteDivs = {};
|
||||
this.logRunningSpecs = false;
|
||||
/*
|
||||
Copyright (c) 2008-2017 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
jasmineRequire.html = function(j$) {
|
||||
j$.ResultsNode = jasmineRequire.ResultsNode();
|
||||
j$.HtmlReporter = jasmineRequire.HtmlReporter(j$);
|
||||
j$.QueryString = jasmineRequire.QueryString();
|
||||
j$.HtmlSpecFilter = jasmineRequire.HtmlSpecFilter();
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
|
||||
var el = document.createElement(type);
|
||||
jasmineRequire.HtmlReporter = function(j$) {
|
||||
|
||||
for (var i = 2; i < arguments.length; i++) {
|
||||
var child = arguments[i];
|
||||
var noopTimer = {
|
||||
start: function() {},
|
||||
elapsed: function() { return 0; }
|
||||
};
|
||||
|
||||
if (typeof child === 'string') {
|
||||
el.appendChild(document.createTextNode(child));
|
||||
} else {
|
||||
if (child) { el.appendChild(child); }
|
||||
}
|
||||
}
|
||||
function HtmlReporter(options) {
|
||||
var env = options.env || {},
|
||||
getContainer = options.getContainer,
|
||||
createElement = options.createElement,
|
||||
createTextNode = options.createTextNode,
|
||||
onRaiseExceptionsClick = options.onRaiseExceptionsClick || function() {},
|
||||
onThrowExpectationsClick = options.onThrowExpectationsClick || function() {},
|
||||
onRandomClick = options.onRandomClick || function() {},
|
||||
addToExistingQueryString = options.addToExistingQueryString || defaultQueryString,
|
||||
filterSpecs = options.filterSpecs,
|
||||
timer = options.timer || noopTimer,
|
||||
results = [],
|
||||
specsExecuted = 0,
|
||||
failureCount = 0,
|
||||
pendingSpecCount = 0,
|
||||
htmlReporterMain,
|
||||
symbols,
|
||||
failedSuites = [];
|
||||
|
||||
for (var attr in attrs) {
|
||||
if (attr == "className") {
|
||||
el[attr] = attrs[attr];
|
||||
} else {
|
||||
el.setAttribute(attr, attrs[attr]);
|
||||
}
|
||||
}
|
||||
|
||||
return el;
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
|
||||
var showPassed, showSkipped;
|
||||
|
||||
this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
|
||||
this.createDom('div', { className: 'banner' },
|
||||
this.createDom('div', { className: 'logo' },
|
||||
this.createDom('span', { className: 'title' }, "Jasmine"),
|
||||
this.createDom('span', { className: 'version' }, runner.env.versionString())),
|
||||
this.createDom('div', { className: 'options' },
|
||||
"Show ",
|
||||
showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
|
||||
this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
|
||||
showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
|
||||
this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
|
||||
)
|
||||
),
|
||||
|
||||
this.runnerDiv = this.createDom('div', { className: 'runner running' },
|
||||
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
|
||||
this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
|
||||
this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
|
||||
this.initialize = function() {
|
||||
clearPrior();
|
||||
htmlReporterMain = createDom('div', {className: 'jasmine_html-reporter'},
|
||||
createDom('div', {className: 'jasmine-banner'},
|
||||
createDom('a', {className: 'jasmine-title', href: 'http://jasmine.github.io/', target: '_blank'}),
|
||||
createDom('span', {className: 'jasmine-version'}, j$.version)
|
||||
),
|
||||
createDom('ul', {className: 'jasmine-symbol-summary'}),
|
||||
createDom('div', {className: 'jasmine-alert'}),
|
||||
createDom('div', {className: 'jasmine-results'},
|
||||
createDom('div', {className: 'jasmine-failures'})
|
||||
)
|
||||
);
|
||||
getContainer().appendChild(htmlReporterMain);
|
||||
};
|
||||
|
||||
this.document.body.appendChild(this.outerDiv);
|
||||
var totalSpecsDefined;
|
||||
this.jasmineStarted = function(options) {
|
||||
totalSpecsDefined = options.totalSpecsDefined || 0;
|
||||
timer.start();
|
||||
};
|
||||
|
||||
var suites = runner.suites();
|
||||
for (var i = 0; i < suites.length; i++) {
|
||||
var suite = suites[i];
|
||||
var suiteDiv = this.createDom('div', { className: 'suite' },
|
||||
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
|
||||
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
|
||||
this.suiteDivs[suite.id] = suiteDiv;
|
||||
var parentDiv = this.outerDiv;
|
||||
if (suite.parentSuite) {
|
||||
parentDiv = this.suiteDivs[suite.parentSuite.id];
|
||||
var summary = createDom('div', {className: 'jasmine-summary'});
|
||||
|
||||
var topResults = new j$.ResultsNode({}, '', null),
|
||||
currentParent = topResults;
|
||||
|
||||
this.suiteStarted = function(result) {
|
||||
currentParent.addChild(result, 'suite');
|
||||
currentParent = currentParent.last();
|
||||
};
|
||||
|
||||
this.suiteDone = function(result) {
|
||||
if (result.status == 'failed') {
|
||||
failedSuites.push(result);
|
||||
}
|
||||
|
||||
if (currentParent == topResults) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentParent = currentParent.parent;
|
||||
};
|
||||
|
||||
this.specStarted = function(result) {
|
||||
currentParent.addChild(result, 'spec');
|
||||
};
|
||||
|
||||
var failures = [];
|
||||
this.specDone = function(result) {
|
||||
if(noExpectations(result) && typeof console !== 'undefined' && typeof console.error !== 'undefined') {
|
||||
console.error('Spec \'' + result.fullName + '\' has no expectations.');
|
||||
}
|
||||
|
||||
if (result.status != 'disabled') {
|
||||
specsExecuted++;
|
||||
}
|
||||
|
||||
if (!symbols){
|
||||
symbols = find('.jasmine-symbol-summary');
|
||||
}
|
||||
|
||||
symbols.appendChild(createDom('li', {
|
||||
className: noExpectations(result) ? 'jasmine-empty' : 'jasmine-' + result.status,
|
||||
id: 'spec_' + result.id,
|
||||
title: result.fullName
|
||||
}
|
||||
));
|
||||
|
||||
if (result.status == 'failed') {
|
||||
failureCount++;
|
||||
|
||||
var failure =
|
||||
createDom('div', {className: 'jasmine-spec-detail jasmine-failed'},
|
||||
createDom('div', {className: 'jasmine-description'},
|
||||
createDom('a', {title: result.fullName, href: specHref(result)}, result.fullName)
|
||||
),
|
||||
createDom('div', {className: 'jasmine-messages'})
|
||||
);
|
||||
var messages = failure.childNodes[1];
|
||||
|
||||
for (var i = 0; i < result.failedExpectations.length; i++) {
|
||||
var expectation = result.failedExpectations[i];
|
||||
messages.appendChild(createDom('div', {className: 'jasmine-result-message'}, expectation.message));
|
||||
messages.appendChild(createDom('div', {className: 'jasmine-stack-trace'}, expectation.stack));
|
||||
}
|
||||
|
||||
failures.push(failure);
|
||||
}
|
||||
|
||||
if (result.status == 'pending') {
|
||||
pendingSpecCount++;
|
||||
}
|
||||
};
|
||||
|
||||
this.jasmineDone = function(doneResult) {
|
||||
var banner = find('.jasmine-banner');
|
||||
var alert = find('.jasmine-alert');
|
||||
var order = doneResult && doneResult.order;
|
||||
alert.appendChild(createDom('span', {className: 'jasmine-duration'}, 'finished in ' + timer.elapsed() / 1000 + 's'));
|
||||
|
||||
banner.appendChild(
|
||||
createDom('div', { className: 'jasmine-run-options' },
|
||||
createDom('span', { className: 'jasmine-trigger' }, 'Options'),
|
||||
createDom('div', { className: 'jasmine-payload' },
|
||||
createDom('div', { className: 'jasmine-exceptions' },
|
||||
createDom('input', {
|
||||
className: 'jasmine-raise',
|
||||
id: 'jasmine-raise-exceptions',
|
||||
type: 'checkbox'
|
||||
}),
|
||||
createDom('label', { className: 'jasmine-label', 'for': 'jasmine-raise-exceptions' }, 'raise exceptions')),
|
||||
createDom('div', { className: 'jasmine-throw-failures' },
|
||||
createDom('input', {
|
||||
className: 'jasmine-throw',
|
||||
id: 'jasmine-throw-failures',
|
||||
type: 'checkbox'
|
||||
}),
|
||||
createDom('label', { className: 'jasmine-label', 'for': 'jasmine-throw-failures' }, 'stop spec on expectation failure')),
|
||||
createDom('div', { className: 'jasmine-random-order' },
|
||||
createDom('input', {
|
||||
className: 'jasmine-random',
|
||||
id: 'jasmine-random-order',
|
||||
type: 'checkbox'
|
||||
}),
|
||||
createDom('label', { className: 'jasmine-label', 'for': 'jasmine-random-order' }, 'run tests in random order'))
|
||||
)
|
||||
));
|
||||
|
||||
var raiseCheckbox = find('#jasmine-raise-exceptions');
|
||||
|
||||
raiseCheckbox.checked = !env.catchingExceptions();
|
||||
raiseCheckbox.onclick = onRaiseExceptionsClick;
|
||||
|
||||
var throwCheckbox = find('#jasmine-throw-failures');
|
||||
throwCheckbox.checked = env.throwingExpectationFailures();
|
||||
throwCheckbox.onclick = onThrowExpectationsClick;
|
||||
|
||||
var randomCheckbox = find('#jasmine-random-order');
|
||||
randomCheckbox.checked = env.randomTests();
|
||||
randomCheckbox.onclick = onRandomClick;
|
||||
|
||||
var optionsMenu = find('.jasmine-run-options'),
|
||||
optionsTrigger = optionsMenu.querySelector('.jasmine-trigger'),
|
||||
optionsPayload = optionsMenu.querySelector('.jasmine-payload'),
|
||||
isOpen = /\bjasmine-open\b/;
|
||||
|
||||
optionsTrigger.onclick = function() {
|
||||
if (isOpen.test(optionsPayload.className)) {
|
||||
optionsPayload.className = optionsPayload.className.replace(isOpen, '');
|
||||
} else {
|
||||
optionsPayload.className += ' jasmine-open';
|
||||
}
|
||||
};
|
||||
|
||||
if (specsExecuted < totalSpecsDefined) {
|
||||
var skippedMessage = 'Ran ' + specsExecuted + ' of ' + totalSpecsDefined + ' specs - run all';
|
||||
var skippedLink = order && order.random ? '?random=true' : '?';
|
||||
alert.appendChild(
|
||||
createDom('span', {className: 'jasmine-bar jasmine-skipped'},
|
||||
createDom('a', {href: skippedLink, title: 'Run all specs'}, skippedMessage)
|
||||
)
|
||||
);
|
||||
}
|
||||
var statusBarMessage = '';
|
||||
var statusBarClassName = 'jasmine-bar ';
|
||||
|
||||
if (totalSpecsDefined > 0) {
|
||||
statusBarMessage += pluralize('spec', specsExecuted) + ', ' + pluralize('failure', failureCount);
|
||||
if (pendingSpecCount) { statusBarMessage += ', ' + pluralize('pending spec', pendingSpecCount); }
|
||||
statusBarClassName += (failureCount > 0) ? 'jasmine-failed' : 'jasmine-passed';
|
||||
} else {
|
||||
statusBarClassName += 'jasmine-skipped';
|
||||
statusBarMessage += 'No specs found';
|
||||
}
|
||||
|
||||
var seedBar;
|
||||
if (order && order.random) {
|
||||
seedBar = createDom('span', {className: 'jasmine-seed-bar'},
|
||||
', randomized with seed ',
|
||||
createDom('a', {title: 'randomized with seed ' + order.seed, href: seedHref(order.seed)}, order.seed)
|
||||
);
|
||||
}
|
||||
|
||||
alert.appendChild(createDom('span', {className: statusBarClassName}, statusBarMessage, seedBar));
|
||||
|
||||
var errorBarClassName = 'jasmine-bar jasmine-errored';
|
||||
var errorBarMessagePrefix = 'AfterAll ';
|
||||
|
||||
for(var i = 0; i < failedSuites.length; i++) {
|
||||
var failedSuite = failedSuites[i];
|
||||
for(var j = 0; j < failedSuite.failedExpectations.length; j++) {
|
||||
alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessagePrefix + failedSuite.failedExpectations[j].message));
|
||||
}
|
||||
}
|
||||
|
||||
var globalFailures = (doneResult && doneResult.failedExpectations) || [];
|
||||
for(i = 0; i < globalFailures.length; i++) {
|
||||
var failure = globalFailures[i];
|
||||
alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessagePrefix + failure.message));
|
||||
}
|
||||
|
||||
var results = find('.jasmine-results');
|
||||
results.appendChild(summary);
|
||||
|
||||
summaryList(topResults, summary);
|
||||
|
||||
function summaryList(resultsTree, domParent) {
|
||||
var specListNode;
|
||||
for (var i = 0; i < resultsTree.children.length; i++) {
|
||||
var resultNode = resultsTree.children[i];
|
||||
if (filterSpecs && !hasActiveSpec(resultNode)) {
|
||||
continue;
|
||||
}
|
||||
if (resultNode.type == 'suite') {
|
||||
var suiteListNode = createDom('ul', {className: 'jasmine-suite', id: 'suite-' + resultNode.result.id},
|
||||
createDom('li', {className: 'jasmine-suite-detail'},
|
||||
createDom('a', {href: specHref(resultNode.result)}, resultNode.result.description)
|
||||
)
|
||||
);
|
||||
|
||||
summaryList(resultNode, suiteListNode);
|
||||
domParent.appendChild(suiteListNode);
|
||||
}
|
||||
if (resultNode.type == 'spec') {
|
||||
if (domParent.getAttribute('class') != 'jasmine-specs') {
|
||||
specListNode = createDom('ul', {className: 'jasmine-specs'});
|
||||
domParent.appendChild(specListNode);
|
||||
}
|
||||
var specDescription = resultNode.result.description;
|
||||
if(noExpectations(resultNode.result)) {
|
||||
specDescription = 'SPEC HAS NO EXPECTATIONS ' + specDescription;
|
||||
}
|
||||
if(resultNode.result.status === 'pending' && resultNode.result.pendingReason !== '') {
|
||||
specDescription = specDescription + ' PENDING WITH MESSAGE: ' + resultNode.result.pendingReason;
|
||||
}
|
||||
specListNode.appendChild(
|
||||
createDom('li', {
|
||||
className: 'jasmine-' + resultNode.result.status,
|
||||
id: 'spec-' + resultNode.result.id
|
||||
},
|
||||
createDom('a', {href: specHref(resultNode.result)}, specDescription)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (failures.length) {
|
||||
alert.appendChild(
|
||||
createDom('span', {className: 'jasmine-menu jasmine-bar jasmine-spec-list'},
|
||||
createDom('span', {}, 'Spec List | '),
|
||||
createDom('a', {className: 'jasmine-failures-menu', href: '#'}, 'Failures')));
|
||||
alert.appendChild(
|
||||
createDom('span', {className: 'jasmine-menu jasmine-bar jasmine-failure-list'},
|
||||
createDom('a', {className: 'jasmine-spec-list-menu', href: '#'}, 'Spec List'),
|
||||
createDom('span', {}, ' | Failures ')));
|
||||
|
||||
find('.jasmine-failures-menu').onclick = function() {
|
||||
setMenuModeTo('jasmine-failure-list');
|
||||
};
|
||||
find('.jasmine-spec-list-menu').onclick = function() {
|
||||
setMenuModeTo('jasmine-spec-list');
|
||||
};
|
||||
|
||||
setMenuModeTo('jasmine-failure-list');
|
||||
|
||||
var failureNode = find('.jasmine-failures');
|
||||
for (i = 0; i < failures.length; i++) {
|
||||
failureNode.appendChild(failures[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return this;
|
||||
|
||||
function find(selector) {
|
||||
return getContainer().querySelector('.jasmine_html-reporter ' + selector);
|
||||
}
|
||||
parentDiv.appendChild(suiteDiv);
|
||||
}
|
||||
|
||||
this.startedAt = new Date();
|
||||
function clearPrior() {
|
||||
// return the reporter
|
||||
var oldReporter = find('');
|
||||
|
||||
var self = this;
|
||||
showPassed.onclick = function(evt) {
|
||||
if (showPassed.checked) {
|
||||
self.outerDiv.className += ' show-passed';
|
||||
} else {
|
||||
self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
|
||||
if(oldReporter) {
|
||||
getContainer().removeChild(oldReporter);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
showSkipped.onclick = function(evt) {
|
||||
if (showSkipped.checked) {
|
||||
self.outerDiv.className += ' show-skipped';
|
||||
} else {
|
||||
self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
|
||||
function createDom(type, attrs, childrenVarArgs) {
|
||||
var el = createElement(type);
|
||||
|
||||
for (var i = 2; i < arguments.length; i++) {
|
||||
var child = arguments[i];
|
||||
|
||||
if (typeof child === 'string') {
|
||||
el.appendChild(createTextNode(child));
|
||||
} else {
|
||||
if (child) {
|
||||
el.appendChild(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var attr in attrs) {
|
||||
if (attr == 'className') {
|
||||
el[attr] = attrs[attr];
|
||||
} else {
|
||||
el.setAttribute(attr, attrs[attr]);
|
||||
}
|
||||
}
|
||||
|
||||
return el;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
|
||||
var results = runner.results();
|
||||
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
|
||||
this.runnerDiv.setAttribute("class", className);
|
||||
//do it twice for IE
|
||||
this.runnerDiv.setAttribute("className", className);
|
||||
var specs = runner.specs();
|
||||
var specCount = 0;
|
||||
for (var i = 0; i < specs.length; i++) {
|
||||
if (this.specFilter(specs[i])) {
|
||||
specCount++;
|
||||
function pluralize(singular, count) {
|
||||
var word = (count == 1 ? singular : singular + 's');
|
||||
|
||||
return '' + count + ' ' + word;
|
||||
}
|
||||
}
|
||||
var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
|
||||
message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
|
||||
this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
|
||||
|
||||
this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
|
||||
};
|
||||
function specHref(result) {
|
||||
return addToExistingQueryString('spec', result.fullName);
|
||||
}
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
|
||||
var results = suite.results();
|
||||
var status = results.passed() ? 'passed' : 'failed';
|
||||
if (results.totalCount === 0) { // todo: change this to check results.skipped
|
||||
status = 'skipped';
|
||||
}
|
||||
this.suiteDivs[suite.id].className += " " + status;
|
||||
};
|
||||
function seedHref(seed) {
|
||||
return addToExistingQueryString('seed', seed);
|
||||
}
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
|
||||
if (this.logRunningSpecs) {
|
||||
this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
|
||||
}
|
||||
};
|
||||
function defaultQueryString(key, value) {
|
||||
return '?' + key + '=' + value;
|
||||
}
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
|
||||
var results = spec.results();
|
||||
var status = results.passed() ? 'passed' : 'failed';
|
||||
if (results.skipped) {
|
||||
status = 'skipped';
|
||||
}
|
||||
var specDiv = this.createDom('div', { className: 'spec ' + status },
|
||||
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
|
||||
this.createDom('a', {
|
||||
className: 'description',
|
||||
href: '?spec=' + encodeURIComponent(spec.getFullName()),
|
||||
title: spec.getFullName()
|
||||
}, spec.description));
|
||||
function setMenuModeTo(mode) {
|
||||
htmlReporterMain.setAttribute('class', 'jasmine_html-reporter ' + mode);
|
||||
}
|
||||
|
||||
function noExpectations(result) {
|
||||
return (result.failedExpectations.length + result.passedExpectations.length) === 0 &&
|
||||
result.status === 'passed';
|
||||
}
|
||||
|
||||
var resultItems = results.getItems();
|
||||
var messagesDiv = this.createDom('div', { className: 'messages' });
|
||||
for (var i = 0; i < resultItems.length; i++) {
|
||||
var result = resultItems[i];
|
||||
function hasActiveSpec(resultNode) {
|
||||
if (resultNode.type == 'spec' && resultNode.result.status != 'disabled') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (result.type == 'log') {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
|
||||
} else if (result.type == 'expect' && result.passed && !result.passed()) {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
|
||||
|
||||
if (result.trace.stack) {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
|
||||
if (resultNode.type == 'suite') {
|
||||
for (var i = 0, j = resultNode.children.length; i < j; i++) {
|
||||
if (hasActiveSpec(resultNode.children[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (messagesDiv.childNodes.length > 0) {
|
||||
specDiv.appendChild(messagesDiv);
|
||||
}
|
||||
|
||||
this.suiteDivs[spec.suite.id].appendChild(specDiv);
|
||||
return HtmlReporter;
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.log = function() {
|
||||
var console = jasmine.getGlobal().console;
|
||||
if (console && console.log) {
|
||||
if (console.log.apply) {
|
||||
console.log.apply(console, arguments);
|
||||
} else {
|
||||
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
|
||||
jasmineRequire.HtmlSpecFilter = function() {
|
||||
function HtmlSpecFilter(options) {
|
||||
var filterString = options && options.filterString() && options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
var filterPattern = new RegExp(filterString);
|
||||
|
||||
this.matches = function(specName) {
|
||||
return filterPattern.test(specName);
|
||||
};
|
||||
}
|
||||
|
||||
return HtmlSpecFilter;
|
||||
};
|
||||
|
||||
jasmineRequire.ResultsNode = function() {
|
||||
function ResultsNode(result, type, parent) {
|
||||
this.result = result;
|
||||
this.type = type;
|
||||
this.parent = parent;
|
||||
|
||||
this.children = [];
|
||||
|
||||
this.addChild = function(result, type) {
|
||||
this.children.push(new ResultsNode(result, type, this));
|
||||
};
|
||||
|
||||
this.last = function() {
|
||||
return this.children[this.children.length - 1];
|
||||
};
|
||||
}
|
||||
|
||||
return ResultsNode;
|
||||
};
|
||||
|
||||
jasmineRequire.QueryString = function() {
|
||||
function QueryString(options) {
|
||||
|
||||
this.navigateWithNewParam = function(key, value) {
|
||||
options.getWindowLocation().search = this.fullStringWithNewParam(key, value);
|
||||
};
|
||||
|
||||
this.fullStringWithNewParam = function(key, value) {
|
||||
var paramMap = queryStringToParamMap();
|
||||
paramMap[key] = value;
|
||||
return toQueryString(paramMap);
|
||||
};
|
||||
|
||||
this.getParam = function(key) {
|
||||
return queryStringToParamMap()[key];
|
||||
};
|
||||
|
||||
return this;
|
||||
|
||||
function toQueryString(paramMap) {
|
||||
var qStrPairs = [];
|
||||
for (var prop in paramMap) {
|
||||
qStrPairs.push(encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop]));
|
||||
}
|
||||
return '?' + qStrPairs.join('&');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.getLocation = function() {
|
||||
return this.document.location;
|
||||
};
|
||||
function queryStringToParamMap() {
|
||||
var paramStr = options.getWindowLocation().search.substring(1),
|
||||
params = [],
|
||||
paramMap = {};
|
||||
|
||||
if (paramStr.length > 0) {
|
||||
params = paramStr.split('&');
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
var p = params[i].split('=');
|
||||
var value = decodeURIComponent(p[1]);
|
||||
if (value === 'true' || value === 'false') {
|
||||
value = JSON.parse(value);
|
||||
}
|
||||
paramMap[decodeURIComponent(p[0])] = value;
|
||||
}
|
||||
}
|
||||
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
jasmine.TrivialReporter.prototype.specFilter = function(spec) {
|
||||
var paramMap = {};
|
||||
var params = this.getLocation().search.substring(1).split('&');
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
var p = params[i].split('=');
|
||||
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
|
||||
}
|
||||
|
||||
if (!paramMap.spec) {
|
||||
return true;
|
||||
}
|
||||
return spec.getFullName().indexOf(paramMap.spec) === 0;
|
||||
return QueryString;
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
http://www.JSON.org/json2.js
|
||||
2009-08-17
|
||||
json2.js
|
||||
2014-02-04
|
||||
|
||||
Public Domain.
|
||||
|
||||
@@ -8,6 +8,14 @@
|
||||
|
||||
See http://www.JSON.org/js.html
|
||||
|
||||
|
||||
This code should be minified before deployment.
|
||||
See http://javascript.crockford.com/jsmin.html
|
||||
|
||||
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
|
||||
NOT CONTROL.
|
||||
|
||||
|
||||
This file creates a global JSON object containing two methods: stringify
|
||||
and parse.
|
||||
|
||||
@@ -136,15 +144,9 @@
|
||||
|
||||
This is a reference implementation. You are free to copy, modify, or
|
||||
redistribute.
|
||||
|
||||
This code should be minified before deployment.
|
||||
See http://javascript.crockford.com/jsmin.html
|
||||
|
||||
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
|
||||
NOT CONTROL.
|
||||
*/
|
||||
|
||||
/*jslint evil: true */
|
||||
/*jslint evil: true, regexp: true */
|
||||
|
||||
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
||||
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
|
||||
@@ -153,16 +155,16 @@
|
||||
test, toJSON, toString, valueOf
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
// Create a JSON object only if one does not already exist. We create the
|
||||
// methods in a closure to avoid creating global variables.
|
||||
|
||||
if (!this.JSON) {
|
||||
this.JSON = {};
|
||||
if (typeof JSON !== 'object') {
|
||||
JSON = {};
|
||||
}
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function f(n) {
|
||||
// Format integers to have at least two digits.
|
||||
@@ -171,37 +173,30 @@ if (!this.JSON) {
|
||||
|
||||
if (typeof Date.prototype.toJSON !== 'function') {
|
||||
|
||||
Date.prototype.toJSON = function (key) {
|
||||
Date.prototype.toJSON = function () {
|
||||
|
||||
return isFinite(this.valueOf()) ?
|
||||
this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z' : null;
|
||||
return isFinite(this.valueOf())
|
||||
? this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z'
|
||||
: null;
|
||||
};
|
||||
|
||||
String.prototype.toJSON =
|
||||
Number.prototype.toJSON =
|
||||
Boolean.prototype.toJSON = function (key) {
|
||||
return this.valueOf();
|
||||
};
|
||||
String.prototype.toJSON =
|
||||
Number.prototype.toJSON =
|
||||
Boolean.prototype.toJSON = function () {
|
||||
return this.valueOf();
|
||||
};
|
||||
}
|
||||
|
||||
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
var cx,
|
||||
escapable,
|
||||
gap,
|
||||
indent,
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
},
|
||||
meta,
|
||||
rep;
|
||||
|
||||
|
||||
@@ -213,17 +208,17 @@ if (!this.JSON) {
|
||||
// sequences.
|
||||
|
||||
escapable.lastIndex = 0;
|
||||
return escapable.test(string) ?
|
||||
'"' + string.replace(escapable, function (a) {
|
||||
var c = meta[a];
|
||||
return typeof c === 'string' ? c :
|
||||
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
}) + '"' :
|
||||
'"' + string + '"';
|
||||
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
|
||||
var c = meta[a];
|
||||
return typeof c === 'string'
|
||||
? c
|
||||
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
}) + '"' : '"' + string + '"';
|
||||
}
|
||||
|
||||
|
||||
function str(key, holder) {
|
||||
|
||||
// Produce a string from holder[key].
|
||||
|
||||
var i, // The loop counter.
|
||||
@@ -301,11 +296,11 @@ if (!this.JSON) {
|
||||
// Join all of the elements together, separated with commas, and wrap them in
|
||||
// brackets.
|
||||
|
||||
v = partial.length === 0 ? '[]' :
|
||||
gap ? '[\n' + gap +
|
||||
partial.join(',\n' + gap) + '\n' +
|
||||
mind + ']' :
|
||||
'[' + partial.join(',') + ']';
|
||||
v = partial.length === 0
|
||||
? '[]'
|
||||
: gap
|
||||
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
|
||||
: '[' + partial.join(',') + ']';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
@@ -315,8 +310,8 @@ if (!this.JSON) {
|
||||
if (rep && typeof rep === 'object') {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
k = rep[i];
|
||||
if (typeof k === 'string') {
|
||||
if (typeof rep[i] === 'string') {
|
||||
k = rep[i];
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
@@ -328,7 +323,7 @@ if (!this.JSON) {
|
||||
// Otherwise, iterate through all of the keys in the object.
|
||||
|
||||
for (k in value) {
|
||||
if (Object.hasOwnProperty.call(value, k)) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
@@ -340,9 +335,11 @@ if (!this.JSON) {
|
||||
// Join all of the member texts together, separated with commas,
|
||||
// and wrap them in braces.
|
||||
|
||||
v = partial.length === 0 ? '{}' :
|
||||
gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
|
||||
mind + '}' : '{' + partial.join(',') + '}';
|
||||
v = partial.length === 0
|
||||
? '{}'
|
||||
: gap
|
||||
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
|
||||
: '{' + partial.join(',') + '}';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
@@ -351,7 +348,18 @@ if (!this.JSON) {
|
||||
// If the JSON object does not yet have a stringify method, give it one.
|
||||
|
||||
if (typeof JSON.stringify !== 'function') {
|
||||
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
};
|
||||
JSON.stringify = function (value, replacer, space) {
|
||||
|
||||
// The stringify method takes a value and an optional replacer, and an optional
|
||||
// space parameter, and returns a JSON text. The replacer can be a function
|
||||
// that can replace values, or an array of strings that will select the keys.
|
||||
@@ -382,7 +390,7 @@ if (!this.JSON) {
|
||||
rep = replacer;
|
||||
if (replacer && typeof replacer !== 'function' &&
|
||||
(typeof replacer !== 'object' ||
|
||||
typeof replacer.length !== 'number')) {
|
||||
typeof replacer.length !== 'number')) {
|
||||
throw new Error('JSON.stringify');
|
||||
}
|
||||
|
||||
@@ -397,6 +405,7 @@ if (!this.JSON) {
|
||||
// If the JSON object does not yet have a parse method, give it one.
|
||||
|
||||
if (typeof JSON.parse !== 'function') {
|
||||
cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
||||
JSON.parse = function (text, reviver) {
|
||||
|
||||
// The parse method takes a text and an optional reviver function, and returns
|
||||
@@ -412,7 +421,7 @@ if (!this.JSON) {
|
||||
var k, v, value = holder[key];
|
||||
if (value && typeof value === 'object') {
|
||||
for (k in value) {
|
||||
if (Object.hasOwnProperty.call(value, k)) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
@@ -430,6 +439,7 @@ if (!this.JSON) {
|
||||
// Unicode characters with escape sequences. JavaScript handles many characters
|
||||
// incorrectly, either silently deleting them, or treating them as line endings.
|
||||
|
||||
text = String(text);
|
||||
cx.lastIndex = 0;
|
||||
if (cx.test(text)) {
|
||||
text = text.replace(cx, function (a) {
|
||||
@@ -451,10 +461,10 @@ if (!this.JSON) {
|
||||
// we look to see that the remaining characters are only whitespace or ']' or
|
||||
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
||||
|
||||
if (/^[\],:{}\s]*$/.
|
||||
test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
|
||||
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
|
||||
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
if (/^[\],:{}\s]*$/
|
||||
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
|
||||
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
|
||||
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
|
||||
// In the third stage we use the eval function to compile the text into a
|
||||
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
||||
@@ -466,8 +476,9 @@ replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
// In the optional fourth stage, we recursively walk the new structure, passing
|
||||
// each name/value pair to a reviver function for possible transformation.
|
||||
|
||||
return typeof reviver === 'function' ?
|
||||
walk({'': j}, '') : j;
|
||||
return typeof reviver === 'function'
|
||||
? walk({'': j}, '')
|
||||
: j;
|
||||
}
|
||||
|
||||
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
||||
|
||||
41
lib/jasmine-core/node_boot.js
Normal file
41
lib/jasmine-core/node_boot.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
Copyright (c) 2008-2017 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
module.exports = function(jasmineRequire) {
|
||||
var jasmine = jasmineRequire.core(jasmineRequire);
|
||||
|
||||
var consoleFns = require('../console/console.js');
|
||||
consoleFns.console(consoleFns, jasmine);
|
||||
|
||||
var env = jasmine.getEnv();
|
||||
|
||||
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||
|
||||
extend(global, jasmineInterface);
|
||||
|
||||
function extend(destination, source) {
|
||||
for (var property in source) destination[property] = source[property];
|
||||
return destination;
|
||||
}
|
||||
|
||||
return jasmine;
|
||||
};
|
||||
@@ -1,6 +1,9 @@
|
||||
#
|
||||
# DO NOT Edit this file. Canonical version of Jasmine lives in the repo's package.json. This file is generated
|
||||
# by a grunt task when the standalone release is built.
|
||||
#
|
||||
module Jasmine
|
||||
module Core
|
||||
VERSION = "1.1.0.rc3"
|
||||
VERSION = "2.6.1"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
34
package.json
Normal file
34
package.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "jasmine-core",
|
||||
"license": "MIT",
|
||||
"version": "2.6.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jasmine/jasmine.git"
|
||||
},
|
||||
"keywords": [
|
||||
"test",
|
||||
"jasmine",
|
||||
"tdd",
|
||||
"bdd"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "grunt jshint execSpecsInNode"
|
||||
},
|
||||
"description": "Official packaging of Jasmine's core files for use by Node.js projects.",
|
||||
"homepage": "http://jasmine.github.io",
|
||||
"main": "./lib/jasmine-core.js",
|
||||
"devDependencies": {
|
||||
"glob": "~7.0.5",
|
||||
"grunt": "^1.0.1",
|
||||
"grunt-cli": "^1.2.0",
|
||||
"grunt-contrib-compass": "^1.1.1",
|
||||
"grunt-contrib-compress": "^1.3.0",
|
||||
"grunt-contrib-concat": "^1.0.1",
|
||||
"grunt-contrib-jshint": "^1.0.0",
|
||||
"jasmine": "^2.5.0",
|
||||
"load-grunt-tasks": "^0.4.0",
|
||||
"shelljs": "^0.7.0",
|
||||
"temp": "~0.8.1"
|
||||
}
|
||||
}
|
||||
1
pages
1
pages
Submodule pages deleted from a9d577eb45
22
release_notes/1.3.0.md
Normal file
22
release_notes/1.3.0.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Jasmine Core 1.3.0 Release Notes
|
||||
|
||||
## Summary
|
||||
This version was a very incremental release that merged in some pull requests for bug fixes.
|
||||
|
||||
## Features
|
||||
|
||||
* HTML Runner exposes UI to not swallow Exceptions, instead raising as soon as thrown
|
||||
* Migrated homepage content to Wiki
|
||||
* Made a far more useful [tutorial page](http://pivotal.github.com/jasmine)
|
||||
* Added a `toBeNaN` matcher
|
||||
|
||||
## Fixes
|
||||
|
||||
* Better detection of in-browser vs. not
|
||||
* `afterEach` functions will run now even when there is a timeout
|
||||
* `toBeCloseTo` matcher is more accurate
|
||||
* More explicit matcher messages for spies
|
||||
* Better equality comparisons for regular expressions
|
||||
* Improvements to the Pretty Printer: controllable recursion depth, don't include inherited properties
|
||||
* Fix where `for` was being used as a property on an object (failed on IE)
|
||||
|
||||
12
release_notes/1.3.1.md
Normal file
12
release_notes/1.3.1.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Jasmine Core 1.3.1 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This release is for browser compatibility fixes
|
||||
|
||||
## Changes
|
||||
|
||||
### Features
|
||||
|
||||
Fixing test runner failures in IE 6/7/8
|
||||
|
||||
70
release_notes/2.0.1.md
Normal file
70
release_notes/2.0.1.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Jasmine Core 2.0.1 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This release is for small bug fixes and enhancements ahead of a real-soon-now 2.1.
|
||||
|
||||
## Changes
|
||||
|
||||
### Features
|
||||
|
||||
* NodeJS is now supported with a jasmine-core npm
|
||||
* [Support browsers that don't supply a `Date.now()` by having a `mockDate` object](http://www.pivotaltracker.com/story/66606132) - Closes #361
|
||||
* [Show message if no specs where loaded](http://www.pivotaltracker.com/story/12784235)
|
||||
* When using `jasmine.any`, the `class` will now be included in the error message
|
||||
* Reporters now receive the number of passed expectations in a spec
|
||||
* Use default failure message for `toBeNaN`
|
||||
* Use the latest `jasmine_selenium_runner` so we use the fix for printing objects with cycles
|
||||
* Add jasmine logo image to HTML runner
|
||||
* Stop Jasmine's CSS affecting the style of the body tag - Closes #600
|
||||
* Standardized location of the standalone distributions - they now live in the repo in `/dist` as well as on the Releases page
|
||||
|
||||
### Bugs
|
||||
|
||||
* Don't allow calling the same done callback multiple times - Fixes #523
|
||||
* [Remove 'empty' as an option as a spec result](http://www.pivotaltracker.com/story/73741032) as this was a breaking change
|
||||
* Instead, we determine if a spec has no expectations using the added
|
||||
key of `passedExpectations` in combination of the `failedExpectations`
|
||||
to determine that there a spec is 'empty'
|
||||
* Fix build in IE8 (IE8 doesn't support `Object.freeze`)
|
||||
* Fix `ObjectContaining` to match recursively
|
||||
|
||||
### Documentation
|
||||
|
||||
* Update release doc to use GitHub releases
|
||||
* Add installation instructions to README - Merges #621
|
||||
* Add Ruby Gem and Python Egg to docs
|
||||
* Add detailed steps on how to contribute - Merges #580 from @pablofiu
|
||||
|
||||
## Pull Requests and Issues
|
||||
|
||||
* Contains is explicitly false if actual is `undefined` or `null` - Fixes #627
|
||||
* namespace `html-reporter` -> `jasmine_html-reporter` - Fixes #600
|
||||
* Throw a more specific error when `expect` is used without a `currentSpec` - Fixes #602
|
||||
* Reduced size of logo with PNG Gauntlet - Merges #588
|
||||
* HTML Reporter resets previous DOM when re-initialized - Merges #594 from @plukevdh
|
||||
* Narrow down raise exceptions query selector; Finding by any input tag is a little bit broad - Closes #605
|
||||
* Pass through custom equality testers in toHaveBeenCalledWith - Fixes #536
|
||||
* Fix outdated copyright year (update to 2014) - Merges #550 from @slothmonster
|
||||
* [Add package.json to Python egg to get correct version number](http://www.pivotaltracker.com/story/67556148) - Fixes #551
|
||||
* Allow users to set the maximum length of array that the pretty-printer
|
||||
will print out - Fixes #323 @mikemoraned and #374 @futuraprime
|
||||
* `matchersUtil.equals()` does not expect a matcher as its first argument,
|
||||
so send the "actual" value first and the "expected" value second. - Merges #538 from @cbandy
|
||||
* Add single quote check to `jshint` and fix src files for that - Closes #522
|
||||
* Remove an `eval` in order to support running jasmine within CSP - Closes #503
|
||||
* Allow matcher custom failure messages to be a function - Closes #520
|
||||
* More color blind friendly CSS from @dleppik - Closes #463 & #509
|
||||
* Use `load-grunt-tasks` Merges #521 from @robinboehm
|
||||
* Special case printing `-0` - Closes #496
|
||||
* Allow stub or spy Date object safely using a closure to get a clean copy - Closes #506
|
||||
* [Use `\d7` instead of plain 'x' for more square appearance](http://www.pivotaltracker.com/story/48434179)
|
||||
* Better support in pretty printer when an object has null prototype - Fixes #500
|
||||
* Update link at top of README to improve access to Jasmine 2.0 docs - Merges #486 from @nextmat
|
||||
* Force query selector to seek within the html-reporter element - Merges #479 from @shprink
|
||||
* Netbeans files are in gitignore - Merges #478 from @shprink
|
||||
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with [Anchorman](http://github.com/infews/anchorman)_
|
||||
25
release_notes/2.0.2.md
Normal file
25
release_notes/2.0.2.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
## Changes
|
||||
|
||||
* keep the files for running in a webpage around in the npm package
|
||||
* Expose files and paths necessary to embed jasmine in an html page for nodejs
|
||||
* Pull out the building of the jasmine interface so node and web both get the same one.
|
||||
* Show a dot with color of pending spec when no expectations
|
||||
* Console reporter prints out failed expectation's message
|
||||
|
||||
### Bugs
|
||||
|
||||
* Allow mocked Date constructor to be called with a subset of full params
|
||||
|
||||
## Pull Requests and Issues
|
||||
|
||||
* a disabled suite should call resultCallback with status being disabled
|
||||
* disabled suite should still call onStart callback
|
||||
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
83
release_notes/2.1.0.md
Normal file
83
release_notes/2.1.0.md
Normal file
@@ -0,0 +1,83 @@
|
||||
# Jasmine Core 2.1.0 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This is the release of Jasmine 2.1.
|
||||
|
||||
## Features
|
||||
|
||||
- Support for focused specs via `fit` and `fdescribe`
|
||||
- Support for `beforeAll` and `afterAll`
|
||||
- Support for an explicit `fail` function, both in synchronous and asynchronous specs
|
||||
- Allow custom timeout for `beforeEach`, `afterEach`, `beforeAll`, `afterAll` and `it`
|
||||
- Spies now track return values
|
||||
- Specs can now specify their own timeouts
|
||||
- Testing in Node.js via the official Jasmine Node Module
|
||||
- Spec results now have `suiteResults` method that behaves similarly to to `specResults`
|
||||
- HtmlReporter shows error alerts for afterAllExceptions
|
||||
|
||||
## Bugs
|
||||
|
||||
- CI now works for IE8 (this was releated to `ConsoleReporter` below)
|
||||
- Detect global object properly when getting the jasmine require obj
|
||||
- Fixes Issue #[569][issue_569] - [Tracker Story #73684570](http://www.pivotaltracker.com/story/73684570)
|
||||
|
||||
## Deprecations
|
||||
|
||||
### `ConsoleReporter` as part of Jasmine core
|
||||
|
||||
The Console Reporter exists nearly entirely for the old manner of running Jasmine's own specs in node.js. As we are now supporting node.js officially, this reporter code no longer needs to be in this repo and instead will be in the Jasmine npm.
|
||||
|
||||
For now you will see a deprecation message. It will be removed entirely in Jasmine 3.0.
|
||||
|
||||
## Documentation
|
||||
|
||||
- Release Notes from previous releases now live at [Jasmine's GitHub release page][releases]. See Tracker Story #[54582902][tracker_1]
|
||||
- Better instructions for releasing new documentation
|
||||
|
||||
[releases]: https://github.com/pivotal/jasmine/releases
|
||||
[tracker_1]: http://www.pivotaltracker.com/story/54582902
|
||||
|
||||
|
||||
## Pull Requests and Issues
|
||||
|
||||
- Simplification of HTMLtags in SpecRunner.html
|
||||
- Merges #[700][issue_700] from @tkrotoff
|
||||
- `toContain` works with array-like objects (Arguments, HTMLCollections, etc)
|
||||
- Merges #[699][issue_699] from @charleshansen
|
||||
- Fixed isPendingSpecException test title
|
||||
- Merges #[691][issue_691] from @ertrzyiks
|
||||
- Fixed an issue with example code in the npm
|
||||
- Merges #[686][issue_686] from @akoptsov
|
||||
- When the Jasmine clock is installed and date is mocked, `new Date() instanceof Date` should equal `true` Issue #[678][issue_678] & Issue #[679][issue_679] from @chernetsov
|
||||
- Support for an explicit `fail` function, both in synchronous and asynchronous specs
|
||||
- Fixes Issue #[567][issue_567], Issue #[568][issue_568], and Issue #[563][issue_563]
|
||||
- Allow custom timeout for `beforeEach`, `afterEach`, `beforeAll`, `afterAll` and `it`
|
||||
- Fixes Issue #[483][issue_483] - specs can now specify their own timeouts
|
||||
- Spies can track return values
|
||||
- Fixes Issue #[660][issue_660], Merged Issue #[669][issue_669] from @mkhanal
|
||||
- Interval handlers can now clear their interval
|
||||
- Fixes Issue #[655][issue_655] Merged Issue #[658][issue_658] from @tgirardi
|
||||
- Updated to the latest `json2.js`
|
||||
- Merges #[616][issue_616] from @apaladox2015
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with [Anchorman](http://github.com/infews/anchorman)_
|
||||
|
||||
[issue_569]: http://github.com/pivotal/jasmine/issues/569
|
||||
[issue_700]: http://github.com/pivotal/jasmine/issues/700
|
||||
[issue_699]: http://github.com/pivotal/jasmine/issues/699
|
||||
[issue_691]: http://github.com/pivotal/jasmine/issues/691
|
||||
[issue_678]: http://github.com/pivotal/jasmine/issues/678
|
||||
[issue_679]: http://github.com/pivotal/jasmine/issues/679
|
||||
[issue_567]: http://github.com/pivotal/jasmine/issues/567
|
||||
[issue_568]: http://github.com/pivotal/jasmine/issues/568
|
||||
[issue_563]: http://github.com/pivotal/jasmine/issues/563
|
||||
[issue_483]: http://github.com/pivotal/jasmine/issues/483
|
||||
[issue_660]: http://github.com/pivotal/jasmine/issues/660
|
||||
[issue_669]: http://github.com/pivotal/jasmine/issues/669
|
||||
[issue_655]: http://github.com/pivotal/jasmine/issues/655
|
||||
[issue_658]: http://github.com/pivotal/jasmine/issues/658
|
||||
[issue_616]: http://github.com/pivotal/jasmine/issues/616
|
||||
[issue_686]: http://github.com/pivotal/jasmine/issues/686
|
||||
14
release_notes/2.1.1.md
Normal file
14
release_notes/2.1.1.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Jasmine Core 2.1.1 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This is a hotfix release of jasmine core to fix a breaking change with events emitted by the top-level suite
|
||||
|
||||
## Issues
|
||||
|
||||
- Top-level suite triggers suiteStarted and suiteEnd to be consistent
|
||||
- Fixes [#706](http://github.com/pivotal/jasmine/issues/706)
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
14
release_notes/2.1.2.md
Normal file
14
release_notes/2.1.2.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Jasmine Core 2.1.2 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This is a hotfix release of jasmine core to fix a breaking change with reporting when all of the specs in a suite are pending.
|
||||
|
||||
## Changes
|
||||
|
||||
- Suites still run their children even if none are executable
|
||||
- Fixes [#707](http://github.com/pivotal/jasmine/issues/707)
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
21
release_notes/2.1.3.md
Normal file
21
release_notes/2.1.3.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Jasmine Core 2.1.3 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This release is primarily a bug-fix release to clean up some recent regressions.
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* Top level suite no longer reports suiteStart and suiteDone
|
||||
- Fixes [#716](https://github.com/jasmine/jasmine/issues/716)
|
||||
|
||||
* Don't keep the expected and actual for a passed expectation
|
||||
- Fixes [#640](https://github.com/jasmine/jasmine/issues/640)
|
||||
- Fixes [#690](https://github.com/jasmine/jasmine/issues/690)
|
||||
|
||||
* Use the new build env on Travis
|
||||
- Merges [#712](https://github.com/jasmine/jasmine/issues/712) from @joshk
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
98
release_notes/2.2.0.md
Normal file
98
release_notes/2.2.0.md
Normal file
@@ -0,0 +1,98 @@
|
||||
# Jasmine Core 2.2.0 Release Notes
|
||||
|
||||
## Changes
|
||||
|
||||
* `ObjectContaining` no longer tries to track exact mismatches
|
||||
* HTML reporter keeps extra query params when focusing on a spec or suite
|
||||
* Check custom properties on Arrays when computing equality
|
||||
* Better error message if `spyOn` is called without a method name
|
||||
* Rename `jasmineMatches` to `asymmetricMatch`
|
||||
* Don't double escape focus spec links
|
||||
* Jasmine equality checks if either side implements `asymmetricMatch`
|
||||
* Add asymmetric equality tester to match a string with a RegExp
|
||||
* Add jshint to node build on Travis for pull request builds
|
||||
* Restructure node examples directory to look more realistic
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* Add a basic bower config
|
||||
- Fixes [#719](https://github.com/jasmine/jasmine/issues/719)
|
||||
|
||||
* Allow `pending` to take a reason and show it in the HtmlReporter
|
||||
- Fixes [#671](https://github.com/jasmine/jasmine/issues/671)
|
||||
|
||||
* Set jasmineGlobal correctly in GJS
|
||||
- Merges [#757](https://github.com/jasmine/jasmine/issues/757) from @ptomato
|
||||
- Fixes [#751](https://github.com/jasmine/jasmine/issues/751)
|
||||
|
||||
* Fix some SpiderMonkey lint warnings
|
||||
- Merges [#752](https://github.com/jasmine/jasmine/issues/752) from @ptomato
|
||||
- Fixes [#751](https://github.com/jasmine/jasmine/issues/751)
|
||||
|
||||
* Prevents *Alls from running when runnables are explicitly set
|
||||
- Fixes [#732](https://github.com/jasmine/jasmine/issues/732)
|
||||
|
||||
* Update contribution guide to mention possible ffi dependencies for Ubuntu
|
||||
- Fixes [#755](https://github.com/jasmine/jasmine/issues/755)
|
||||
|
||||
* Fix spelling mistake in contributors guide
|
||||
- Merges [#746](https://github.com/jasmine/jasmine/issues/746) from @swirlycheetah
|
||||
|
||||
* Use new jasmine github repo url
|
||||
- Merges [#745](https://github.com/jasmine/jasmine/issues/745) rohit
|
||||
|
||||
* Allow `createSpyObj` to be called with just an array of method names
|
||||
- Fixes [#321](https://github.com/jasmine/jasmine/issues/321)
|
||||
|
||||
* Add `arrayContaining` matcher
|
||||
- Merges [#440](https://github.com/jasmine/jasmine/issues/440) from @slackersoft
|
||||
|
||||
* Use the stack trace from the Error object if supplied
|
||||
- Fixes [#734](https://github.com/jasmine/jasmine/issues/734)
|
||||
|
||||
* Update readme with link to upgrading doc and mention browser support.
|
||||
- Fixes [#739](https://github.com/jasmine/jasmine/issues/739)
|
||||
|
||||
* Link to the Jasmine NPM module
|
||||
- Merges [#736](https://github.com/jasmine/jasmine/issues/736) from @moonmaster9000
|
||||
|
||||
* Allow null prototype objects to be compared for equality
|
||||
- Merges [#731](https://github.com/jasmine/jasmine/issues/731) from @rohit
|
||||
- Fixes [#729](https://github.com/jasmine/jasmine/issues/729)
|
||||
|
||||
* Fix URL's of Jasmine repositories on Github
|
||||
- Merges [#730](https://github.com/jasmine/jasmine/issues/730) from @rohit
|
||||
|
||||
* Add `anything` matcher to match any value that is neither null or undefined
|
||||
- Fixes [#186](https://github.com/jasmine/jasmine/issues/186)
|
||||
|
||||
* Allow asymmetric equality testers to preempt their symmetric brethren
|
||||
- Fixes [#540](https://github.com/jasmine/jasmine/issues/540)
|
||||
|
||||
* Check for `ObjectContaining` on either side of equality
|
||||
- Fixes [#682](https://github.com/jasmine/jasmine/issues/682)
|
||||
|
||||
* Display the name of the constructor when pretty printing objects
|
||||
- Fixes [#598](https://github.com/jasmine/jasmine/issues/598)
|
||||
|
||||
* `toMatch` requires the `expected` to be a String or RegExp
|
||||
- Fixes [#723](https://github.com/jasmine/jasmine/issues/723)
|
||||
|
||||
* Better equality comparison of Dom nodes
|
||||
- Merges [#657](https://github.com/jasmine/jasmine/issues/657) from @alexeibs
|
||||
|
||||
* Hide unnecessary files from the npm package
|
||||
- Fixes [#726](https://github.com/jasmine/jasmine/issues/726)
|
||||
|
||||
* Properly record finishing an `xdescribe` so further cleanup works
|
||||
- Fixes [#724](https://github.com/jasmine/jasmine/issues/724)
|
||||
|
||||
* Reschedule all functions for a tick before executing any. This allows any function run during a tick to cancel any other in the same tick.
|
||||
- Fixes [#708](https://github.com/jasmine/jasmine/issues/708)
|
||||
|
||||
* Pass through all args from external interface for befores, afters, its
|
||||
- Fixes [#483](https://github.com/jasmine/jasmine/issues/483)
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
15
release_notes/2.2.1.md
Normal file
15
release_notes/2.2.1.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Jasmine Core 2.2.1 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This is a hotfix release to fix the packaging for bower
|
||||
|
||||
## Changes
|
||||
|
||||
* Fix missing comma on bower.json
|
||||
- Merges [#763](https://github.com/jasmine/jasmine/issues/763) from @gabrielhpugliese
|
||||
- Merges [#764](https://github.com/jasmine/jasmine/issues/764) from @joshuacc
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
81
release_notes/2.3.0.md
Normal file
81
release_notes/2.3.0.md
Normal file
@@ -0,0 +1,81 @@
|
||||
# Jasmine Core 2.3.0 Release Notes
|
||||
|
||||
## Changes
|
||||
|
||||
* Style disabled specs in the results list
|
||||
* Use `onclick` directly to better support older webkit
|
||||
* Don't use deprecated `onComplete` syntax for jasmine-npm
|
||||
* Allow the clock to be installed for the duration of a single closure
|
||||
* Add safari 7 & 8 to browser matrix
|
||||
* Remove unused standaloneBuilder var from Gruntfile
|
||||
* Add test script to package.json
|
||||
* Update bower.json keywords to match package.json keywords
|
||||
* Add keywords to package.json
|
||||
* refuse to execute an order if it would cause a suite with a beforeAll or afterAll to be re-entered after leaving once
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* Specify a main entry point for bower so it can be loaded easier
|
||||
- Merges [#827](https://github.com/jasmine/jasmine/issues/827) from @davetron5000
|
||||
|
||||
* Use `instanceof` when checking Error types in toThrowError
|
||||
- Fixes [#819](https://github.com/jasmine/jasmine/issues/819)
|
||||
|
||||
* Remove periods from bullet points for consistency with rest of document
|
||||
- Merge [#818](https://github.com/jasmine/jasmine/issues/818) from @lpww
|
||||
|
||||
* Subjective readability improvements to CONTRIBUTING.md
|
||||
- Merge [#815](https://github.com/jasmine/jasmine/issues/815) from @jhamon
|
||||
|
||||
* Don't install the clock if the current timing functions aren't the originals
|
||||
- Fixes [#782](https://github.com/jasmine/jasmine/issues/782)
|
||||
|
||||
* Properly pass `j$` to `Any` so it can use other jasmine stuff
|
||||
- Fixes [#806](https://github.com/jasmine/jasmine/issues/806)
|
||||
|
||||
* Correctly handle functions that are scheduled after the clock is uninstalled and reinstalled from within Clock#tick.
|
||||
- Merges [#804](https://github.com/jasmine/jasmine/issues/804) from @sgravrock
|
||||
- Fixes [#790](https://github.com/jasmine/jasmine/issues/790).
|
||||
|
||||
* Allow user to stop a specs execution when an expectation fails
|
||||
- Fixes [#577](https://github.com/jasmine/jasmine/issues/577)
|
||||
|
||||
* Remove unnecessary conditional
|
||||
- Merges [#788](https://github.com/jasmine/jasmine/issues/788) from @toddbranch
|
||||
|
||||
* Show the name of the constructor function when printing an `any` instead of a `toString` of the entire constructor
|
||||
- Fixes [#796](https://github.com/jasmine/jasmine/issues/796)
|
||||
|
||||
* Don't use hardcoded temporary directory paths
|
||||
- Merges [#789](https://github.com/jasmine/jasmine/issues/789) from sgravrock
|
||||
|
||||
* Execute beforeAll/afterAll once per suite instead of once per child when running focused specs/suites
|
||||
- Fixes [#773](https://github.com/jasmine/jasmine/issues/773)
|
||||
|
||||
* Report children of an xdescribe similarly to how they would be reported if they were themselves x'd out
|
||||
- Fixes [#774](https://github.com/jasmine/jasmine/issues/774)
|
||||
- Fixes [#776](https://github.com/jasmine/jasmine/issues/776)
|
||||
|
||||
* Fixes issue where mock clock was being used by QueueRunner
|
||||
- Fixes [#783](https://github.com/jasmine/jasmine/issues/783)
|
||||
- Fixes [#792](https://github.com/jasmine/jasmine/issues/792)
|
||||
|
||||
* add missing semicolon
|
||||
- Merges [#775](https://github.com/jasmine/jasmine/issues/775) from @joscha
|
||||
|
||||
* ObjectContaining matches prototype properties
|
||||
- Fixes [#769](https://github.com/jasmine/jasmine/issues/769)
|
||||
|
||||
* Updates pretty printer to include array properties
|
||||
- Fixes [#766](https://github.com/jasmine/jasmine/issues/766)
|
||||
|
||||
* Update year copyright
|
||||
- Merges [#768](https://github.com/jasmine/jasmine/issues/768) from @danilovaz
|
||||
|
||||
* Allow arrays from different frames or contexts to be equal
|
||||
- Merges [#767](https://github.com/jasmine/jasmine/issues/767) from @juliemr
|
||||
- Fixes [#765](https://github.com/jasmine/jasmine/issues/765)
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
14
release_notes/2.3.1.md
Normal file
14
release_notes/2.3.1.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Jasmine 2.3.1 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This release is a packaging update for bower only.
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* Point Bower's main field to jasmine.js, which is browser-friendly.
|
||||
- Merge [#843](https://github.com/jasmine/jasmine/issues/843) from @evoL
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
14
release_notes/2.3.2.md
Normal file
14
release_notes/2.3.2.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Jasmine 2.3.2 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This is a hotfix release to fix a regression with specs declared without a function body
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* A spec without a function provided should be `pending` not `disabled`
|
||||
- Fixes [#840](https://github.com/jasmine/jasmine/issues/840)
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
14
release_notes/2.3.3.md
Normal file
14
release_notes/2.3.3.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Jasmine 2.3.3 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This is a hotfix release to fix a regression with the execution context for `beforeAll`
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* Set the shared user context correctly when executing the top level suite
|
||||
- Fixes [#846](https://github.com/jasmine/jasmine/issues/846)
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
22
release_notes/2.3.4.md
Normal file
22
release_notes/2.3.4.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Jasmine 2.3.4 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This is a hotfix release to fix a regression with execution ordering
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* Fix ordering for suites with more than 11 direct children.
|
||||
- Fixes [#850](https://github.com/jasmine/jasmine/issues/850)
|
||||
|
||||
* Update standalone installation instructions to reference the releases page
|
||||
- Fixes [#603](https://github.com/jasmine/jasmine/issues/603)
|
||||
|
||||
* Remove dead CSS class styles
|
||||
- Merges [#849](https://github.com/jasmine/jasmine/issues/849) from @prather-mcs
|
||||
- Merges [#848](https://github.com/jasmine/jasmine/issues/848) from @prather-mcs
|
||||
- Fixes [#847](https://github.com/jasmine/jasmine/issues/847)
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
91
release_notes/2.4.0.md
Normal file
91
release_notes/2.4.0.md
Normal file
@@ -0,0 +1,91 @@
|
||||
# Jasmine Core 2.4.0 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This release contains a number of fixes and pull requests.
|
||||
The most notable is probably that Jasmine now supports randomization of spec order
|
||||
|
||||
## Changes
|
||||
|
||||
* Run jasmine's specs in random order
|
||||
* Add support for returning run details for reporting randomness
|
||||
* Use className instead of class when creating DOM elements
|
||||
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* Syntax highlighting in README.md
|
||||
- Merges [#973](https://github.com/jasmine/jasmine/issues/973) from @brunoqc
|
||||
|
||||
* Added a throw error block in describe incase a function with arguments is passed in describe
|
||||
- Fixes [#896](https://github.com/jasmine/jasmine/issues/896)
|
||||
- Merges [#955](https://github.com/jasmine/jasmine/issues/955) from @himajasuman
|
||||
|
||||
* Remove unused `queueableFn` arg from `onException`
|
||||
- Fixes [#958](https://github.com/jasmine/jasmine/issues/958)
|
||||
|
||||
* Remove unused parameter from toThrowError
|
||||
- Merges [#957](https://github.com/jasmine/jasmine/issues/957) from @FuzzySockets
|
||||
|
||||
* Abort spying when the target cannot be spied upon
|
||||
- Fixes [#948](https://github.com/jasmine/jasmine/issues/948)
|
||||
- Merges [#949](https://github.com/jasmine/jasmine/issues/949) from @StephanBijzitter
|
||||
|
||||
* Removed GOALS_2.0.md, doesn't seem to be needed anymore
|
||||
- Merges [#954](https://github.com/jasmine/jasmine/issues/954) from @matthewhuff89
|
||||
|
||||
* Change #xit so that it will output a more BDD-style pending message
|
||||
- Merges [#942](https://github.com/jasmine/jasmine/issues/942) from @lalunamel
|
||||
- Fixes [#930](https://github.com/jasmine/jasmine/issues/930)
|
||||
- Fixes [#912](https://github.com/jasmine/jasmine/issues/912)
|
||||
|
||||
* Allow tests to run in random order
|
||||
- Merges [#927](https://github.com/jasmine/jasmine/issues/927) from @marcioj
|
||||
|
||||
* Use toString for objects if it has been overriden
|
||||
- Merges [#929](https://github.com/jasmine/jasmine/issues/929) from @myitcv
|
||||
- Fixes [#928](https://github.com/jasmine/jasmine/issues/928)
|
||||
|
||||
* Fix circles/x from getting cut off on Mac/chrome
|
||||
- Merges [#932](https://github.com/jasmine/jasmine/issues/932) from @James-Dunn
|
||||
|
||||
* Postpone find() until it is needed
|
||||
- Merges [#924](https://github.com/jasmine/jasmine/issues/924) from @danielalexiuc
|
||||
- Fixes [#917](https://github.com/jasmine/jasmine/issues/917)
|
||||
|
||||
* check for global before assigning
|
||||
* Reverse suite afterEach behavior to match semantics?
|
||||
- Merges [#908](https://github.com/jasmine/jasmine/issues/908) from @mcamac
|
||||
|
||||
* Use badges from shields.io
|
||||
- Merges [#902](https://github.com/jasmine/jasmine/issues/902) from @SimenB
|
||||
|
||||
* xdescribe marks pending, plus associated tests.
|
||||
- Merges [#869](https://github.com/jasmine/jasmine/issues/869) from @ljwall
|
||||
- Fixes [#855](https://github.com/jasmine/jasmine/issues/855)
|
||||
|
||||
* Update glob to latest
|
||||
- Merge [#892](https://github.com/jasmine/jasmine/issues/892) from @obastemur
|
||||
- Fixes [#891](https://github.com/jasmine/jasmine/issues/891)
|
||||
|
||||
* Remove moot `version` property from bower.json
|
||||
- Merges [#874](https://github.com/jasmine/jasmine/issues/874) from @kkirsche
|
||||
|
||||
* add toHaveBeenCalledTimes matcher
|
||||
- Merges [#871](https://github.com/jasmine/jasmine/issues/871) from @logankd
|
||||
- Fixes [#853](https://github.com/jasmine/jasmine/issues/853)
|
||||
|
||||
* Update CONTRIBUTING.md
|
||||
- Merges [#856](https://github.com/jasmine/jasmine/issues/856) from @lpww
|
||||
|
||||
* Make the HtmlReport CSS classes "unique enough"
|
||||
- Merges [#851](https://github.com/jasmine/jasmine/issues/851) from @prather-mcs
|
||||
- Fixes [#844](https://github.com/jasmine/jasmine/issues/844)
|
||||
|
||||
* Raise an error when jasmine.any() isn't passed a constructor
|
||||
- Merges [#854](https://github.com/jasmine/jasmine/issues/854) from @danfinnie
|
||||
- Fixes [#852](https://github.com/jasmine/jasmine/issues/852)
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
11
release_notes/2.4.1.md
Normal file
11
release_notes/2.4.1.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Jasmine Core 2.4.1 Release Notes
|
||||
|
||||
## Changes
|
||||
|
||||
* Run `afterEach` in reverse order declared as before
|
||||
- Reverts [#908](https://github.com/jasmine/jasmine/issues/908)
|
||||
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
116
release_notes/2.5.0.md
Normal file
116
release_notes/2.5.0.md
Normal file
@@ -0,0 +1,116 @@
|
||||
# Jasmine 2.5.0 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This release contains a number of fixes and pull requests.
|
||||
|
||||
## Changes
|
||||
|
||||
* Rename `j$` to `jasmineUnderTest` for specs
|
||||
- Please update any pull requests to simplify merging, thanks.
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* Prettyprint objects whose constructors have custom toString method
|
||||
- Fixes [#1019](https://github.com/jasmine/jasmine/issues/1019)
|
||||
- Merges [#1099](https://github.com/jasmine/jasmine/issues/1099) from @mbildner
|
||||
|
||||
* Add gulp-jasmine-browser link to readme
|
||||
- Fixes [#1089](https://github.com/jasmine/jasmine/issues/1089)
|
||||
|
||||
* Exclude lib directory from codeclimate
|
||||
- Fixes [#1171](https://github.com/jasmine/jasmine/issues/1171)
|
||||
|
||||
* Add instructions for testing in IE
|
||||
- Merges [#1170](https://github.com/jasmine/jasmine/issues/1170) from @benchristel
|
||||
|
||||
* Update devDependencies and fix issues from this
|
||||
- Merges [#1162](https://github.com/jasmine/jasmine/issues/1162) from @amavisca
|
||||
|
||||
* Remove runnableLookupTable which is no longer used
|
||||
- Merges [#1129](https://github.com/jasmine/jasmine/issues/1129) from @gregeninfrank
|
||||
|
||||
* Make `toEqual` pass for arrays with equivalent properties
|
||||
- Merges [#1155](https://github.com/jasmine/jasmine/issues/1155) from @benchristel
|
||||
|
||||
* Update ruby version on travis to let rack install
|
||||
- Merges [#1152](https://github.com/jasmine/jasmine/issues/1152) from @amavisca
|
||||
|
||||
* Fix jasmine setup in Electron environment
|
||||
- Merges [#1079](https://github.com/jasmine/jasmine/issues/1079) from @skupr
|
||||
- Fixes [#964](https://github.com/jasmine/jasmine/issues/964)
|
||||
|
||||
* Improve errors with the domain and how to use the API
|
||||
- Merges [#1026](https://github.com/jasmine/jasmine/issues/1026) from @dhoko
|
||||
- Fixes [#1025](https://github.com/jasmine/jasmine/issues/1025)
|
||||
|
||||
* The done function now returns null
|
||||
- Merges [#1062](https://github.com/jasmine/jasmine/issues/1062) from @marneborn
|
||||
- Fixes [#992](https://github.com/jasmine/jasmine/issues/992)
|
||||
|
||||
* Add .editorconfig file
|
||||
- Merges [#1058](https://github.com/jasmine/jasmine/issues/1058) from @kapke
|
||||
- Fixes [#1057](https://github.com/jasmine/jasmine/issues/1057)
|
||||
|
||||
* Improve error message when passing a non-function to callFake
|
||||
- Merges [#1059](https://github.com/jasmine/jasmine/issues/1059) from @kapke
|
||||
- Fixes [#1016](https://github.com/jasmine/jasmine/issues/1016)
|
||||
|
||||
* Allow expectations in a global beforeAll or afterAll
|
||||
- Fixes [#811](https://github.com/jasmine/jasmine/issues/811)
|
||||
|
||||
* Correctly tear down spies on inherited methods
|
||||
- Merges [#1036](https://github.com/jasmine/jasmine/issues/1036) from @benchristel
|
||||
- Fixes [#737](https://github.com/jasmine/jasmine/issues/737)
|
||||
|
||||
* Array equality treats undefined elements as equal however they got in there
|
||||
- Fixes [#786](https://github.com/jasmine/jasmine/issues/786)
|
||||
|
||||
* Add support for a fallback reporter
|
||||
- Merges [#1009](https://github.com/jasmine/jasmine/issues/1009) from @mauricioborges
|
||||
|
||||
* Grunt task for compass should prefix command with 'bundle exec'
|
||||
- Merges [#1047](https://github.com/jasmine/jasmine/issues/1047) from @d-reinhold
|
||||
|
||||
* Fix `toEqual` for Microsoft Edge
|
||||
- Merges [#1041](https://github.com/jasmine/jasmine/issues/1041) from @everedifice
|
||||
|
||||
* Update describe error message to no longer assume errant args are `done`
|
||||
- Fixes [#896](https://github.com/jasmine/jasmine/issues/896)
|
||||
|
||||
* Add toBeGreatThanOrEqual and toBeLessThanOrEqual matchers
|
||||
- Merges [#1049](https://github.com/jasmine/jasmine/issues/1049) from @rullopat
|
||||
- Fixes [#1013](https://github.com/jasmine/jasmine/issues/1013)
|
||||
|
||||
* Support call count of 0 with toHaveBeenCalledTimes matcher
|
||||
- Merges [#1048](https://github.com/jasmine/jasmine/issues/1048) from @logankd
|
||||
- Fixes [#994](https://github.com/jasmine/jasmine/issues/994)
|
||||
|
||||
* Correctly clean up spies after a spy is replaced and re-spied upon
|
||||
- Merges [#1011](https://github.com/jasmine/jasmine/issues/1011) from @bodawei
|
||||
- Fixes [#1010](https://github.com/jasmine/jasmine/issues/1010)
|
||||
|
||||
* remove extra topSuite `queueRunner` construction parameter
|
||||
- Merges [#1006](https://github.com/jasmine/jasmine/issues/1006) from @jurko-gospodnetic
|
||||
|
||||
* add option to shallow clone args in call tracker
|
||||
- Merges [#1000](https://github.com/jasmine/jasmine/issues/1000) from @a-r-d
|
||||
- Fixes [#872](https://github.com/jasmine/jasmine/issues/872)
|
||||
|
||||
* Update license year range to 2016
|
||||
- Merges [#1021](https://github.com/jasmine/jasmine/issues/1021) from pra85
|
||||
|
||||
* Persist randomize param in 'run all' links
|
||||
- Merges [#990](https://github.com/jasmine/jasmine/issues/990) from @basawyer
|
||||
|
||||
* make DelayedFunctionScheduler update the mockDate
|
||||
- Fixes [#915](https://github.com/jasmine/jasmine/issues/915)
|
||||
- Merges [#980](https://github.com/jasmine/jasmine/issues/980) from @andrewiggings
|
||||
|
||||
* Allow `spyOn` to allow a respy for functions that have already been spied upon
|
||||
- Merges [#953](https://github.com/jasmine/jasmine/issues/953) from @guy-mograbi-at-gigaspaces
|
||||
- Fixes [#931](https://github.com/jasmine/jasmine/issues/931)
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
19
release_notes/2.5.1.md
Normal file
19
release_notes/2.5.1.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Jasmine 2.5.1 Release Notes
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* fallback on assignment when a spy cannot be deleted
|
||||
- Merges [#1193](https://github.com/jasmine/jasmine/issues/1193) from @seanparmlee
|
||||
- Fixes [#1189](https://github.com/jasmine/jasmine/issues/1189)
|
||||
|
||||
* Fix issue with equality of Arrays in PhantomJS
|
||||
- Merges [#1192](https://github.com/jasmine/jasmine/issues/1192) from @logankd
|
||||
- Fixes [#1188](https://github.com/jasmine/jasmine/issues/1188)
|
||||
|
||||
* Properly tick date along with clock
|
||||
- Fixes [#1190](https://github.com/jasmine/jasmine/issues/1190)
|
||||
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
14
release_notes/2.5.2.md
Normal file
14
release_notes/2.5.2.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Jasmine 2.5.2 Release Notes
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* Allow currently registered reporters to be cleared
|
||||
- [jasmine/jasmine-npm#88](https://github.com/jasmine/jasmine-npm/issues/88)
|
||||
|
||||
|
||||
* Use `isFunction` to check for functionness in `callFake`
|
||||
- Fixes [#1191](https://github.com/jasmine/jasmine/issues/1191)
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
108
release_notes/2.6.0.md
Normal file
108
release_notes/2.6.0.md
Normal file
@@ -0,0 +1,108 @@
|
||||
# Jasmine 2.6.0 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This release contains a number of fixes and pull requests.
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
Updating introduction url to last version
|
||||
- Merges [#1316](https://github.com/jasmine/jasmine/issues/1316) from @rachelcarmena
|
||||
|
||||
* Throw a recognizable Error message when `fail` outside of a spec.
|
||||
- Fixes [#1017](https://github.com/jasmine/jasmine/issues/1017)
|
||||
|
||||
* Allow the matcher provide a custom error message
|
||||
- Merges [#1298](https://github.com/jasmine/jasmine/issues/1298) from @deckar01
|
||||
- Fixes [#1123](https://github.com/jasmine/jasmine/issues/1123)
|
||||
|
||||
* Fix the order in which afterAll hooks are run to match afterEach
|
||||
- Merges [#1312](https://github.com/jasmine/jasmine/issues/1312) from @gdborton
|
||||
- Fixes [#1311](https://github.com/jasmine/jasmine/issues/1311)
|
||||
|
||||
* Add matchers for positive and negative infinity
|
||||
- Merges [#1300](https://github.com/jasmine/jasmine/issues/1300) from @toubou91
|
||||
- Fixes [#1294](https://github.com/jasmine/jasmine/issues/1294)
|
||||
|
||||
* Add a first pass at JSDocs for the intended public API
|
||||
- Fixes [#596](https://github.com/jasmine/jasmine/issues/596)
|
||||
|
||||
* Pretty print objects passed to fail method
|
||||
- Merges [#1283](https://github.com/jasmine/jasmine/issues/1283) from @mmmichl
|
||||
- Fixes [#1090](https://github.com/jasmine/jasmine/issues/1090)
|
||||
|
||||
* Properly check for Error constructor from a different frame
|
||||
- Merges [#1275](https://github.com/jasmine/jasmine/issues/1275) from @anseki
|
||||
- Fixes [#1252](https://github.com/jasmine/jasmine/issues/1252)
|
||||
|
||||
* Add toHaveBeenCalledBefore matcher
|
||||
- Merges [#1242](https://github.com/jasmine/jasmine/issues/1242) from @DamienCassou
|
||||
|
||||
* Collect unhandled exceptions and pass them to the current runnable
|
||||
- Fixes [#529](https://github.com/jasmine/jasmine/issues/529)
|
||||
- Fixes [#937](https://github.com/jasmine/jasmine/issues/937)
|
||||
|
||||
* Nicer error messages for `spyOn` when `null` is provided
|
||||
- Fixes [#1258](https://github.com/jasmine/jasmine/issues/1258)
|
||||
|
||||
* Require arguments to beforeEach, it, etc, to be actual functions
|
||||
- Merges [#1222](https://github.com/jasmine/jasmine/issues/1222) from @voithos
|
||||
- Fixes [#1004](https://github.com/jasmine/jasmine/issues/1004)
|
||||
|
||||
* Update MIT.LICENSE for new year
|
||||
- Merges [#1249](https://github.com/jasmine/jasmine/issues/1249) from @Scottkao85
|
||||
|
||||
* Update README.md for new year
|
||||
- Merges [#1248](https://github.com/jasmine/jasmine/issues/1248) from @Nebojsaa
|
||||
|
||||
* Remove unused `message` param from Suite#pend
|
||||
- See [#1132](https://github.com/jasmine/jasmine/issues/1132)
|
||||
|
||||
* Fix bug where before/afterAll were being executed in disabled suites.
|
||||
- Merges [#1225](https://github.com/jasmine/jasmine/issues/1225) from @voithos
|
||||
- Fixes [#1175](https://github.com/jasmine/jasmine/issues/1175)
|
||||
|
||||
* Make toEqual matcher report the difference between objects
|
||||
- Merges [#1163](https://github.com/jasmine/jasmine/issues/1163) from @benchristel
|
||||
- Fixes [#675](https://github.com/jasmine/jasmine/issues/675)
|
||||
- Merges [#1236](https://github.com/jasmine/jasmine/issues/1236) from @benchristel
|
||||
|
||||
|
||||
* Implement spies for get/set functions on accessor properties
|
||||
- Merges [#1203](https://github.com/jasmine/jasmine/issues/1203) from @celluj34
|
||||
- Merges [#1008](https://github.com/jasmine/jasmine/issues/1008) from @smacker
|
||||
- Fixes [#943](https://github.com/jasmine/jasmine/issues/943)
|
||||
|
||||
* When the HtmlReporter has a 'spec' query param, the spec list only shows matching specs/suites
|
||||
- Merges [#1046](https://github.com/jasmine/jasmine/issues/1046) from @d-reinhold
|
||||
- Fixes [#510](https://github.com/jasmine/jasmine/issues/510)
|
||||
|
||||
* createSpyObj may use object for method/response shorthand
|
||||
- Merges [#1101](https://github.com/jasmine/jasmine/issues/1101) from @mbildner
|
||||
|
||||
* Separate clear stack and run it after each spec
|
||||
- Fixes [#985](https://github.com/jasmine/jasmine/issues/985)
|
||||
- Fixes [#945](https://github.com/jasmine/jasmine/issues/945)
|
||||
- Fixes [#366](https://github.com/jasmine/jasmine/issues/366)
|
||||
|
||||
* Now spies preserve original function arity
|
||||
- Merges [#1055](https://github.com/jasmine/jasmine/issues/1055) from @kapke
|
||||
- Fixes [#991](https://github.com/jasmine/jasmine/issues/991)
|
||||
|
||||
* Added support for ES6 sets to toContain and toEqual.
|
||||
- Merges [#1067](https://github.com/jasmine/jasmine/issues/1067) from @alur
|
||||
|
||||
* Correctly pretty print objects from other contexts (e.g. iframes) and which do not override toString
|
||||
- Merges [#1091](https://github.com/jasmine/jasmine/issues/1091) from @thatfulvioguy
|
||||
- Fixes [#1087](https://github.com/jasmine/jasmine/issues/1087)
|
||||
|
||||
* Pass custom testers to asymmetric testers
|
||||
- Merges [#1139](https://github.com/jasmine/jasmine/issues/1139) from @joeyparrish
|
||||
- Fixes [#1138](https://github.com/jasmine/jasmine/issues/1138)
|
||||
|
||||
* Fix bad url in README
|
||||
- Merges [#1215](https://github.com/jasmine/jasmine/issues/1215) from @mattc41190
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
31
release_notes/2.6.1.md
Normal file
31
release_notes/2.6.1.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Jasmine 2.6.1 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
This is a patch release to fix some regressions in the 2.6.0 release
|
||||
|
||||
## Pull Requests & Issues
|
||||
|
||||
* Update README.md to make installation instructions more version-agnostic
|
||||
- Merges #1319 from @reinrl
|
||||
|
||||
* Check for `process.listeners` as well, for GlobalErrors
|
||||
- Fixes #1333
|
||||
|
||||
* allow explicit undefined as function for `it` and `xit`
|
||||
- Merges #1329 from @UziTech
|
||||
- Fixes #1328
|
||||
|
||||
* remove eval to create spy wrapper
|
||||
- Merges #1330 from @UziTech
|
||||
- Fixes #1325
|
||||
|
||||
* iterate through keys with a regular for loop
|
||||
- Merges #1326 from @seanparmelee
|
||||
- Fixes #1321
|
||||
- Fixes #1324
|
||||
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||
179
release_notes/20.md
Normal file
179
release_notes/20.md
Normal file
@@ -0,0 +1,179 @@
|
||||
# Jasmine Core 2.0 Release Notes
|
||||
|
||||
## Summary
|
||||
|
||||
These notes are for Jasmine Core 2.0.
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
The [`introduction.js`][intro] page covers the current syntax, highlighting the changes. Here are the known interface changes that are not backwards compatible with 1.x.
|
||||
|
||||
* New syntax for asynchronous specs
|
||||
* New syntax for spies
|
||||
* New interface for reporters
|
||||
* Better Equality testing
|
||||
* Replaced custom matchers for ease of use
|
||||
* Change to `toThrow` matcher
|
||||
* Clock now remains installed when a spec finishes
|
||||
* More Jasmine internal variables/functions have been moved into closures
|
||||
|
||||
### New syntax for asynchronous specs
|
||||
|
||||
Similar to [Mocha][mocha], Jasmine `before`s, `spec`s, and `after`s can take an optional `done` callback in order to force asynchronous tests. The next function, whether it's a `before`, `spec` or `after`, will wait until this function is called or until a timeout is reached.
|
||||
|
||||
### New syntax for spies
|
||||
|
||||
Spies have a slightly modified syntax. The idea came from a desire to preserve any of the properties on a spied-upon function and some better testing patterns.
|
||||
|
||||
### New interface for reporters
|
||||
|
||||
The reporter interface has been **replaced**. The callbacks are different and more consistent. The objects passed in should only provide what is needed to report results. This enforces an interface to result data so custom reporters will be less coupled to the Jasmine implementation. The Jasmine reporter API now includes a slot for a `timer` object.
|
||||
|
||||
### Better Equality testing
|
||||
|
||||
We removed the previous equality code and are now using new code for testing equality. We started with [Underscore.js][underscore]'s `isEqual`, refactored a bit and added some additional tests.
|
||||
|
||||
### Replaced custom matchers for ease of use
|
||||
|
||||
The interface for adding custom matchers has been **replaced**. It has always been possible to add custom matchers, but the API was barely documented and difficult to test. We've changed how matchers are added and tested. Jasmine adds its own matchers by the same mechanism that custom matchers use. Dogfooding FTW.
|
||||
|
||||
### Change to `toThrow` matcher
|
||||
|
||||
We've changed the behavior of the `toThrow` matcher, moving some functionality to the `toThrowError` matcher. This should allow more of the requested use cases.
|
||||
|
||||
### Clock now remains installed when a spec finishes
|
||||
|
||||
After installing the Jasmine Clock, it will stay installed until `uninstall` is called -- clearing up any ambiguity for when those timing functions will revert to using the global clock object.
|
||||
|
||||
## More Jasmine internal variables/functions have been moved into closures
|
||||
|
||||
Certain variables/functions like a function to get the next spec id have been moved into closures, making the Jasmine interface cleaner.
|
||||
|
||||
## Other Changes
|
||||
|
||||
* Massive refactoring and better testing
|
||||
* Environment setup now in `boot.js`
|
||||
* Development and Build moved to Grunt
|
||||
* Changes to how Jasmine is loaded
|
||||
* Changes to how Jasmine is tested
|
||||
* Better node.js support
|
||||
* Better Continuous Integration Environment at Travis
|
||||
* Support matrix updated
|
||||
* Removed JsDoc Pages
|
||||
* Adding Code Climate for JavaScript
|
||||
|
||||
## Massive refactoring and better testing
|
||||
|
||||
This is the biggest set of changes. We've touched nearly every file and every object. We've merged objects together and factored out code. We styled the code more consistently. We've improved nearly every test.
|
||||
|
||||
In general, Jasmine is made of smaller, more-loosely-coupled objects, unit-tested with explicit dependencies injected. This made tests easier to read, write, and maintain. We know this has made Jasmine development easier for the core team. We expect (and hope) this makes it easier for the community to extend Jasmine and provide pull requests that make more sense the first time out.
|
||||
|
||||
## Environment setup now in `boot.js`
|
||||
|
||||
Instantiation and setup of the Jasmine environment, including building reporters, exposing the "global" functions, and executing tests has moved into its own file: `boot.js`. This should make it easier to add custom reporters, configure some objects, or just in general change how you use Jasmine from the outside.
|
||||
|
||||
For example, during development, Jasmine uses its own `devboot.js` to load itself twice - once from `jasmine.js` and once from the source directories.
|
||||
|
||||
## Development and Build moved to Grunt
|
||||
|
||||
We've moved away from Ruby and embraced [Node.js][node] and [Grunt.js][grunt] for the various command line tasks during development. Yes, it's a just a different set of dependencies. But it's less code for the team to maintain - it turns out that JavaScript tools are pretty good at building JavaScript projects. This will make it easier for the community to make sure contributions work in browsers and in Node.js before submitting Pull Requests. There is more detail in the [Contributor's Guide][contrib].
|
||||
|
||||
## Changes to how Jasmine is loaded
|
||||
|
||||
We did not want to add new run-time dependencies, yet we needed to be cleaner when loading Jasmine. So we wrote a custom "require" scheme that works in Node.js and in browsers. This only affects pull requests which add files - please be careful in these cases. Again, the [Contributor's Guide][contrib] should help.
|
||||
|
||||
## Changes to how Jasmine is tested with Jasmine
|
||||
|
||||
Writing a custom require system helped enforce self-testing - the built `jasmine.js` testing Jasmine from the source directories. Overall this has improved the stability of the code. When you look at Jasmine's tests, you'll see both `jasmine` and `j$` used. The former, `jasmine`, will always be used to test the code from source, which is loaded into the reference `j$`. Please adhere to this pattern when writing tests for contributions.
|
||||
|
||||
## Better node.js support
|
||||
|
||||
`Node.js` is now officially a first-class citizen. For a long time we've made sure tests were green in Node before releasing. But it is now officially part of Jasmine's CI build at [Travis][travis]. For the curious, the [`node_suite.js`][node_suite], is essentially a `boot.js` for Node. An official `npm` is coming.
|
||||
|
||||
## Better Continuous Integration Environment at Travis
|
||||
|
||||
The [CI build at Travis][travis_jasmine] now runs the core specs in a build matrix across browsers. It's far from complete on the operating system matrix, but you will see that Jasmine runs against: Firefox, Chrome, Safari 5, Safari 6, [Phantom.js][phantom], [Node.js][node], and IE versions 8, 9, and 10. Big thanks to [SauceLabs][sauce] for their support of open source projects. We will happily take pull requests for additional OS/Browser combos within the matrix.
|
||||
|
||||
## Support Matrix Updated
|
||||
|
||||
We're dropping support for IE < 8. [Jasmine 1.x][jasmine_downloads] remains for projects that need to support older browsers.
|
||||
|
||||
## Removed JsDoc Pages
|
||||
|
||||
Comments in code are lies waiting to happen. Jasmine's JsDoc comments were no exception. The comments were out of date, the generated pages were even more out of date, and frankly they were not helpful. So they're gone.
|
||||
|
||||
Last year saw the posting of the [`introduction.js`][intro] page to document the real, practical interface for projects to use. This page has received a lot of positive feedback so expect more pages like this one.
|
||||
|
||||
## Adding Code Climate for JavaScript
|
||||
|
||||
We are running Code Climate for Jasmine. We have some work to do here but it's helping us easily find code hotspots.
|
||||
|
||||
## Pull Requests and Issues
|
||||
|
||||
The following Pull Requests were merged:
|
||||
|
||||
* ObjectContaining wrong filed value error message #[394](https://github.com/pivotal/jasmine/issues/394) from albertandrejev
|
||||
* Removed unnecessary parameter from `suiteFactory()` call #[397](https://github.com/pivotal/jasmine/issues/397) from valera-rozuvan
|
||||
* `jasmine.Any` supports `Boolean` #[392](https://github.com/pivotal/jasmine/issues/392) from albertandrejev
|
||||
* Reporters get execution time #[30](https://github.com/pivotal/jasmine/issues/30)
|
||||
* `toThrow` matchers handle falsy exceptions #[317](https://github.com/pivotal/jasmine/issues/371)
|
||||
* Removed deprecated `jasmine.Matchers.pp` #[363](https://github.com/pivotal/jasmine/issues/363) from robinboehm
|
||||
* Fix for Clock ticking to default to 0 #[340](https://github.com/pivotal/jasmine/issues/340) from Caio Cunha
|
||||
* Whitespace failures should be easier to understand #[332](https://github.com/pivotal/jasmine/issues/332) from bjornblomqvist
|
||||
* Fix for more markdown-y image for Build status #[329](https://github.com/pivotal/jasmine/issues/329) from sunliwen
|
||||
* UTF-8 encoding fixes #[333](https://github.com/pivotal/jasmine/issues/333) from bjornblomqvist
|
||||
* Replaced deprecated octal literal with hexadecimal from kris7t
|
||||
* Make getGlobal() work in strict mode from metaweta
|
||||
* Clears timeout timer even when async spec throws an exception from tidoust
|
||||
* Timeouts scheduled within a delayed function are correctly scheduled and executed from maciej-filip-sz
|
||||
|
||||
### Bug Fixes
|
||||
* Improved the performance of the HTML output with a CSS change #[428](https://github.com/pivotal/jasmine/issues/428) - Thanks @tjgrathwell
|
||||
* Removed an accidental global pollution of `j$` as a reference to Jasmine. Thanks to Morten Maxild from the mailing list
|
||||
* There is now a consistent `this` between `beforeEach`, `it` and `afterEach` for a spec
|
||||
* A spy's strategy now has properties `returnValue` and `throwError` because they are better names
|
||||
* Make it easy to copy the title of failing specs from the HTML output
|
||||
* Don't add periods to the full name of a spec fix #[427](https://github.com/pivotal/jasmine/issues/427)
|
||||
* Allow Env to take optional spec/suite ids when asked to `execute`
|
||||
* [Mock clock now less intrusive, replacing global timer functions only when clock is installed](http://www.pivotaltracker.com/story/54168708)
|
||||
* Restore custom failure messages for `toHaveBeenCalledWith`
|
||||
* Jasmine global object has a addCustomEqualityTester and addMatchers (no longer directly on global)
|
||||
* Fixed a global leak of `timer`
|
||||
* Remove currentRunner from Env (users can use topSuite from Env instead)
|
||||
* [Specs without expectations are now considered passing](http://www.pivotaltracker.com/story/59422744)
|
||||
* Improve error message when a spec does not call the async callback within the default time interval
|
||||
* Allow passing a negativeCompare in a custom matcher for more custom implementations when `.not` is called
|
||||
* Update favicon to be higher resolution
|
||||
* Make all async functions be subject to the timeout
|
||||
|
||||
There were several other pull requests that either had already been fixed, or were good starting points for the various changes above. Thank you for all of the hard work to keep Jasmine awesome.
|
||||
|
||||
## Other Bugs and Features
|
||||
|
||||
There were a few small changes and fixes that didn't fit into any of the above categories:
|
||||
|
||||
* HTML Reporter refactored for simplicity and performance
|
||||
* Default character encoding on the HTML runner page is UTF-8
|
||||
* [Escape special regex characters from the spec param](http://www.pivotaltracker.com/story/52731407)
|
||||
* Favicon returns
|
||||
* [Clock supports `eval`'d strings as functions](http://www.pivotaltracker.com/story/40853563)
|
||||
* There should always be stack traces on failures
|
||||
* Removed references to unused `jasmine.VERBOSE`
|
||||
* Removed references to unused `jasmine.XmlHttpRequest`
|
||||
|
||||
[mocha]: http://visionmedia.github.io/mocha/
|
||||
[underscore]: http://underscorejs.org/
|
||||
[grunt]: http://gruntjs.com
|
||||
[node]: http://nodejs.org
|
||||
[phantom]: http://phantomjs.org
|
||||
[jasmine_downloads]: https://github.com/pivotal/jasmine/downloads
|
||||
[contrib]: https://github.com/pivotal/jasmine/blob/master/CONTRIBUTING.md
|
||||
[travis]: http://travis-ci.org
|
||||
[travis_jasmine]: http://travis-ci.org/jasmine
|
||||
[sauce]: http://saucelabs.com
|
||||
[node_suite]: https://github.com/pivotal/jasmine/blob/master/spec/node_suite.js
|
||||
[intro]: http://jasmine.github.io/2.0/introduction.html
|
||||
|
||||
------
|
||||
|
||||
_Release Notes generated with [Anchorman](http://github.com/infews/anchorman)_
|
||||
110
release_notes/older_versions.md
Normal file
110
release_notes/older_versions.md
Normal file
@@ -0,0 +1,110 @@
|
||||
# Release 1.0.1.1 — November 9, 2010
|
||||
|
||||
## Jasmine Gem
|
||||
|
||||
## Bugs fixed
|
||||
* Rails 3.0 and RSpec 2.0 are now supported.
|
||||
|
||||
|
||||
## Known issues
|
||||
* Rails 3 generators are not yet implemented -- coming soon!
|
||||
|
||||
|
||||
-----
|
||||
# Release 1.0.1 — October 5, 2010
|
||||
-----
|
||||
|
||||
## Jasmine Core
|
||||
|
||||
## Bugs fixed
|
||||
* Bug fixes for Internet Explorer (thanks fschwiet, fabiomcosta, and jfirebaugh).
|
||||
|
||||
|
||||
## Jasmine Gem
|
||||
|
||||
## Bugs fixed
|
||||
* Bug fix for Windows (thanks jfirebaugh).
|
||||
|
||||
|
||||
-----
|
||||
# Release 1.0 — September 14, 2010
|
||||
-----
|
||||
|
||||
## Jasmine Core
|
||||
|
||||
## Features
|
||||
* `waitsFor()` arguments can now be specified in any order. Timeout and message are optional.
|
||||
* The default `waitsFor()` timeout period is now specified in `env.defaultTimeoutInterval`; the default value is 5 seconds.
|
||||
* Added link to jasmine site from html runner.
|
||||
* Added license file to standalone distribution.
|
||||
* New friendly version number.
|
||||
|
||||
|
||||
## Bugs fixed
|
||||
* `waitsFor()` hanged forever if latch function never returned true.
|
||||
* The `not.toThrow()` matcher threw an exception when used with no args.
|
||||
* The `toThrow()` matcher, when inverted, gave misleading failure messages.
|
||||
* Spy matchers, when inverted, gave misleading failure messages.
|
||||
|
||||
|
||||
## Deprecations
|
||||
* Deprecated `waits()` block in favor of `waitsFor()`; `waits()` will be removed in a future release.
|
||||
* Deprecated `toNotBe()`, `toNotEqual()`, `toNotMatch()`, and `toNotContain()` matchers; they will be removed in a future release.
|
||||
* Console X was removed from the distribution as it was no longer used.
|
||||
* To give us some flexibility for future features, wrapped matcher functions now return `undefined` (they previously returned `true` or `false`, but this was undocumented).
|
||||
|
||||
|
||||
## Jasmine Gem
|
||||
|
||||
## Features
|
||||
* Jasmine now supports JRuby.
|
||||
* Jasmine now supports Ruby 1.9.
|
||||
|
||||
|
||||
## Bugs fixed
|
||||
* Various generator issues fixed.
|
||||
|
||||
|
||||
## Known issues
|
||||
* Rails 3 and RSpec 2 are not yet fully supported.
|
||||
|
||||
|
||||
-----
|
||||
# Release 0.11.1 — June 25, 2010
|
||||
-----
|
||||
|
||||
## Jasmine Core
|
||||
|
||||
### Features
|
||||
* Jasmine no longer logs "Jasmine Running…" messages to the log by default. This can be enabled in runner.html by adding 'trivialReporter.logRunningSpecs = true;'.
|
||||
* The `wasCalled()`, `wasCalledWith()`, `wasNotCalled()` and `wasNotCalledWith()` matchers have been deprecated. The new matchers `toHaveBeenCalled()` and `toHaveBeenCalledWith()` have been added. You can use the `not` prefix to achieve equivalent of the `wasNot…()` expectation (e.g. `not.toHaveBeenCalled()`).
|
||||
|
||||
|
||||
## Notables
|
||||
* A barebones version of Jasmine is now available on <a href="http://pivotal.github.com/jasmine/">http://pivotal.github.com/jasmine/</a>.
|
||||
|
||||
|
||||
-----
|
||||
# Release 0.11.0 — June 23, 2010
|
||||
-----
|
||||
## Jasmine Core
|
||||
|
||||
## Features
|
||||
* The version number has been removed from the generated single-file /lib/jasmine.js. We're also now uploading this file, with the version number in the filename, to github's Downloads page.
|
||||
* Old-style matchers (those using this.report(), from before 0.10.x) are no longer supported. See the <span class="caps">README</span> for instructions on writing new-style matchers.
|
||||
* <strong>jasmine.log</strong> pretty-prints its parameters to the spec's output.
|
||||
* Jasmine no longer depends on 'window'.
|
||||
* <span class="caps">HTML</span> runner should show number of passes/fails by spec, not expectation.
|
||||
* Small modification to JsApiReporter data format.
|
||||
|
||||
|
||||
## Bugs fixed:
|
||||
* If multiple beforeEach blocks were declared, they were executed in reverse order.
|
||||
* Specs with duplicate names confused TrivialReporter output.
|
||||
* Errors in describe functions caused later tests to be weirdly nested.
|
||||
* Nested specs weren't reported properly by the JsApiReporter.
|
||||
|
||||
|
||||
## Known issues:
|
||||
* If you turn on the mock clock, you'll get a spurious log message at the end of your spec.
|
||||
|
||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
ordereddict==1.1
|
||||
47
setup.py
Normal file
47
setup.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from setuptools import setup, find_packages, os
|
||||
import json
|
||||
|
||||
with open('package.json') as packageFile:
|
||||
version = json.load(packageFile)['version']
|
||||
|
||||
setup(
|
||||
name="jasmine-core",
|
||||
version=version,
|
||||
url="http://jasmine.github.io",
|
||||
author="Pivotal Labs",
|
||||
author_email="jasmine-js@googlegroups.com",
|
||||
description=('Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on '+
|
||||
'browsers, DOM, or any JavaScript framework. Thus it\'s suited for websites, '+
|
||||
'Node.js (http://nodejs.org) projects, or anywhere that JavaScript can run.'),
|
||||
license='MIT',
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Environment :: Console',
|
||||
'Environment :: Web Environment',
|
||||
'Framework :: Django',
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 2',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.2',
|
||||
'Programming Language :: Python :: 3.3',
|
||||
'Programming Language :: Python :: Implementation :: PyPy',
|
||||
'Topic :: Internet :: WWW/HTTP',
|
||||
'Topic :: Software Development :: Libraries :: Python Modules',
|
||||
'Topic :: Software Development :: Build Tools',
|
||||
'Topic :: Software Development :: Quality Assurance',
|
||||
'Topic :: Software Development :: Testing',
|
||||
],
|
||||
|
||||
packages=['jasmine_core', 'jasmine_core.images'],
|
||||
package_dir={'jasmine_core': 'lib/jasmine-core', 'jasmine_core.images': 'images'},
|
||||
package_data={'jasmine_core': ['*.js', '*.css'], 'jasmine_core.images': ['*.png']},
|
||||
|
||||
include_package_data=True,
|
||||
|
||||
install_requires=['glob2>=0.4.1', 'ordereddict==1.1']
|
||||
)
|
||||
@@ -1,451 +1,270 @@
|
||||
describe("ConsoleReporter", function() {
|
||||
//keep these literal. otherwise the test loses value as a test.
|
||||
function green(str) {
|
||||
return '\033[32m' + str + '\033[0m';
|
||||
}
|
||||
|
||||
function red(str) {
|
||||
return '\033[31m' + str + '\033[0m';
|
||||
}
|
||||
|
||||
function yellow(str) {
|
||||
return '\033[33m' + str + '\033[0m';
|
||||
}
|
||||
|
||||
function prefixGreen(str) {
|
||||
return '\033[32m' + str;
|
||||
}
|
||||
|
||||
function prefixRed(str) {
|
||||
return '\033[31m' + str;
|
||||
}
|
||||
|
||||
var newline = "\n";
|
||||
|
||||
var passingSpec = {
|
||||
results: function() {
|
||||
return {
|
||||
passed: function() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
failingSpec = {
|
||||
results: function() {
|
||||
return {
|
||||
passed: function() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
skippedSpec = {
|
||||
results: function() {
|
||||
return {skipped: true};
|
||||
}
|
||||
},
|
||||
passingRun = {
|
||||
specs: function() {
|
||||
return [null, null, null];
|
||||
},
|
||||
results: function() {
|
||||
return {failedCount: 0, items_: [null, null, null]};
|
||||
}
|
||||
},
|
||||
failingRun = {
|
||||
specs: function() {
|
||||
return [null, null, null];
|
||||
},
|
||||
results: function() {
|
||||
return {
|
||||
failedCount: 7, items_: [null, null, null]};
|
||||
}
|
||||
};
|
||||
|
||||
function repeatedlyInvoke(f, times) {
|
||||
for (var i = 0; i < times; i++) f(times + 1);
|
||||
}
|
||||
|
||||
function repeat(thing, times) {
|
||||
var arr = [];
|
||||
for (var i = 0; i < times; i++) arr.push(thing);
|
||||
return arr;
|
||||
}
|
||||
|
||||
function simulateRun(reporter, specResults, suiteResults, finalRunner, startTime, endTime) {
|
||||
reporter.reportRunnerStarting();
|
||||
for (var i = 0; i < specResults.length; i++) {
|
||||
reporter.reportSpecResults(specResults[i]);
|
||||
}
|
||||
for (i = 0; i < suiteResults.length; i++) {
|
||||
reporter.reportSuiteResults(suiteResults[i]);
|
||||
}
|
||||
reporter.runnerStartTime = startTime;
|
||||
reporter.now = function() {
|
||||
return endTime;
|
||||
};
|
||||
reporter.reportRunnerResults(finalRunner);
|
||||
}
|
||||
|
||||
var reporter, out, done;
|
||||
var out;
|
||||
|
||||
beforeEach(function() {
|
||||
out = (function() {
|
||||
var output = "";
|
||||
return {
|
||||
print:function(str) {
|
||||
print: function(str) {
|
||||
output += str;
|
||||
},
|
||||
getOutput:function() {
|
||||
return output;
|
||||
getOutput: function() {
|
||||
return output.replace('ConsoleReporter is deprecated and will be removed in a future version.', '');
|
||||
},
|
||||
clear: function() {
|
||||
output = "";
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
done = false;
|
||||
reporter = new jasmine.ConsoleReporter(out.print, function(runner) {
|
||||
done = true
|
||||
});
|
||||
}());
|
||||
});
|
||||
|
||||
|
||||
describe('Integration', function() {
|
||||
it("prints the proper output under a pass scenario - small numbers.", function() {
|
||||
simulateRun(reporter,
|
||||
repeat(passingSpec, 3),
|
||||
[],
|
||||
{
|
||||
specs: function() {
|
||||
return [null, null, null];
|
||||
},
|
||||
results:function() {
|
||||
return {
|
||||
items_: [null, null, null],
|
||||
totalCount: 7,
|
||||
failedCount: 0
|
||||
};
|
||||
}
|
||||
},
|
||||
1000,
|
||||
1777
|
||||
);
|
||||
|
||||
var output = out.getOutput();
|
||||
expect(output).toMatch(/^Started/);
|
||||
expect(output).toMatch(/\.\.\./);
|
||||
expect(output).toMatch(/3 specs, 0 failures/);
|
||||
it("reports that the suite has started to the console", function() {
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print
|
||||
});
|
||||
|
||||
it("prints the proper output under a pass scenario. large numbers.", function() {
|
||||
simulateRun(reporter,
|
||||
repeat(passingSpec, 57),
|
||||
[],
|
||||
{
|
||||
specs: function() {
|
||||
return [null, null, null];
|
||||
},
|
||||
results:function() {
|
||||
return {
|
||||
items_: [null, null, null],
|
||||
totalCount: 7,
|
||||
failedCount: 0
|
||||
};
|
||||
}
|
||||
},
|
||||
1000,
|
||||
1777);
|
||||
reporter.jasmineStarted();
|
||||
|
||||
var output = out.getOutput();
|
||||
expect(output).toMatch(/^Started/);
|
||||
expect(output).toMatch(/\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\./);
|
||||
expect(output).toMatch(/3 specs, 0 failures/);
|
||||
});
|
||||
|
||||
it("prints the proper output under a failure scenario.", function() {
|
||||
simulateRun(reporter,
|
||||
[failingSpec, passingSpec, failingSpec],
|
||||
[
|
||||
{description:"The oven",
|
||||
results:function() {
|
||||
return {
|
||||
items_:[
|
||||
{failedCount:2,
|
||||
description:"heats up",
|
||||
items_:[
|
||||
{trace:{stack:"stack trace one\n second line"}},
|
||||
{trace:{stack:"stack trace two"}}
|
||||
]}
|
||||
]
|
||||
};
|
||||
}},
|
||||
{description:"The washing machine",
|
||||
results:function() {
|
||||
return {
|
||||
items_:[
|
||||
{failedCount:2,
|
||||
description:"washes clothes",
|
||||
items_:[
|
||||
{trace:{stack:"stack trace one"}}
|
||||
]}
|
||||
]
|
||||
};
|
||||
}}
|
||||
],
|
||||
{
|
||||
specs: function() {
|
||||
return [null, null, null];
|
||||
},
|
||||
results:function() {
|
||||
return {
|
||||
items_: [null, null, null],
|
||||
totalCount: 7,
|
||||
failedCount: 2
|
||||
};
|
||||
}
|
||||
},
|
||||
1000,
|
||||
1777);
|
||||
|
||||
var output = out.getOutput();
|
||||
expect(output).toMatch(/^Started/);
|
||||
expect(output).toMatch(/F\.F/);
|
||||
expect(output).toMatch(/The oven heats up\n stack trace one\n second line\n stack trace two/);
|
||||
expect(output).toMatch(/The washing machine washes clothes\n stack trace one/);
|
||||
expect(output).toMatch(/3 specs, 2 failures/);
|
||||
});
|
||||
expect(out.getOutput()).toEqual("Started\n");
|
||||
});
|
||||
|
||||
describe('When a Jasmine environment executes', function() {
|
||||
it("starts the provided timer when jasmine starts", function() {
|
||||
var timerSpy = jasmine.createSpyObj('timer', ['start']),
|
||||
reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print,
|
||||
timer: timerSpy
|
||||
});
|
||||
|
||||
reporter.jasmineStarted();
|
||||
|
||||
expect(timerSpy.start).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("reports a passing spec as a dot", function() {
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print
|
||||
});
|
||||
|
||||
reporter.specDone({status: "passed"});
|
||||
|
||||
expect(out.getOutput()).toEqual(".");
|
||||
});
|
||||
|
||||
it("does not report a disabled spec", function() {
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print
|
||||
});
|
||||
|
||||
reporter.specDone({status: "disabled"});
|
||||
|
||||
expect(out.getOutput()).toEqual("");
|
||||
});
|
||||
|
||||
it("reports a failing spec as an 'F'", function() {
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print
|
||||
});
|
||||
|
||||
reporter.specDone({status: "failed"});
|
||||
|
||||
expect(out.getOutput()).toEqual("F");
|
||||
});
|
||||
|
||||
it("reports a pending spec as a '*'", function() {
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print
|
||||
});
|
||||
|
||||
reporter.specDone({status: "pending"});
|
||||
|
||||
expect(out.getOutput()).toEqual("*");
|
||||
});
|
||||
|
||||
it("alerts user if there are no specs", function(){
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print
|
||||
});
|
||||
|
||||
reporter.jasmineStarted();
|
||||
out.clear();
|
||||
reporter.jasmineDone();
|
||||
|
||||
expect(out.getOutput()).toMatch(/No specs found/);
|
||||
});
|
||||
|
||||
it("reports a summary when done (singular spec and time)", function() {
|
||||
var timerSpy = jasmine.createSpyObj('timer', ['start', 'elapsed']),
|
||||
reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print,
|
||||
timer: timerSpy
|
||||
});
|
||||
|
||||
reporter.jasmineStarted();
|
||||
reporter.specDone({status: "passed"});
|
||||
|
||||
timerSpy.elapsed.and.returnValue(1000);
|
||||
|
||||
out.clear();
|
||||
reporter.jasmineDone();
|
||||
|
||||
expect(out.getOutput()).toMatch(/1 spec, 0 failures/);
|
||||
expect(out.getOutput()).not.toMatch(/0 pending specs/);
|
||||
expect(out.getOutput()).toMatch("Finished in 1 second\n");
|
||||
});
|
||||
|
||||
it("reports a summary when done (pluralized specs and seconds)", function() {
|
||||
var timerSpy = jasmine.createSpyObj('timer', ['start', 'elapsed']),
|
||||
reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print,
|
||||
timer: timerSpy
|
||||
});
|
||||
|
||||
reporter.jasmineStarted();
|
||||
reporter.specDone({status: "passed"});
|
||||
reporter.specDone({status: "pending"});
|
||||
reporter.specDone({
|
||||
status: "failed",
|
||||
description: "with a failing spec",
|
||||
fullName: "A suite with a failing spec",
|
||||
failedExpectations: [
|
||||
{
|
||||
passed: false,
|
||||
message: "Expected true to be false.",
|
||||
expected: false,
|
||||
actual: true,
|
||||
stack: "foo\nbar\nbaz"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
out.clear();
|
||||
|
||||
timerSpy.elapsed.and.returnValue(100);
|
||||
|
||||
reporter.jasmineDone();
|
||||
|
||||
expect(out.getOutput()).toMatch(/3 specs, 1 failure, 1 pending spec/);
|
||||
expect(out.getOutput()).toMatch("Finished in 0.1 seconds\n");
|
||||
});
|
||||
|
||||
it("reports a summary when done that includes stack traces for a failing suite", function() {
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print
|
||||
});
|
||||
|
||||
reporter.jasmineStarted();
|
||||
reporter.specDone({status: "passed"});
|
||||
reporter.specDone({
|
||||
status: "failed",
|
||||
description: "with a failing spec",
|
||||
fullName: "A suite with a failing spec",
|
||||
failedExpectations: [
|
||||
{
|
||||
passed: false,
|
||||
message: "Expected true to be false.",
|
||||
expected: false,
|
||||
actual: true,
|
||||
stack: "foo bar baz"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
out.clear();
|
||||
|
||||
reporter.jasmineDone();
|
||||
|
||||
expect(out.getOutput()).toMatch(/true to be false/);
|
||||
expect(out.getOutput()).toMatch(/foo bar baz/);
|
||||
});
|
||||
|
||||
describe('onComplete callback', function(){
|
||||
var onComplete, reporter;
|
||||
|
||||
beforeEach(function() {
|
||||
reporter.reportRunnerStarting();
|
||||
onComplete = jasmine.createSpy('onComplete');
|
||||
reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print,
|
||||
onComplete: onComplete
|
||||
});
|
||||
reporter.jasmineStarted();
|
||||
});
|
||||
|
||||
it("should print 'Started' to the console", function() {
|
||||
expect(out.getOutput()).toEqual("Started" + newline);
|
||||
it("is called when the suite is done", function() {
|
||||
reporter.jasmineDone();
|
||||
expect(onComplete).toHaveBeenCalledWith(true);
|
||||
});
|
||||
|
||||
describe('when a spec reports', function() {
|
||||
beforeEach(function() {
|
||||
out.clear();
|
||||
});
|
||||
|
||||
it("prints a green dot if the spec passes", function() {
|
||||
reporter.reportSpecResults(passingSpec);
|
||||
|
||||
expect(out.getOutput()).toMatch(/\./);
|
||||
});
|
||||
|
||||
it("prints a red dot if the spec fails", function() {
|
||||
reporter.reportSpecResults(failingSpec);
|
||||
|
||||
expect(out.getOutput()).toMatch(/F/);
|
||||
});
|
||||
|
||||
it("prints a yellow star if the spec was skipped", function() {
|
||||
reporter.reportSpecResults(skippedSpec);
|
||||
|
||||
expect(out.getOutput()).toMatch(/\*/);
|
||||
});
|
||||
it('calls it with false if there are spec failures', function() {
|
||||
reporter.specDone({status: "failed", failedExpectations: []});
|
||||
reporter.jasmineDone();
|
||||
expect(onComplete).toHaveBeenCalledWith(false);
|
||||
});
|
||||
|
||||
describe('when a suite reports', function() {
|
||||
var emptyResults;
|
||||
beforeEach(function() {
|
||||
emptyResults = function() {
|
||||
return {
|
||||
items_:[]
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
it("remembers suite results", function() {
|
||||
reporter.reportSuiteResults({description: "Oven", results: emptyResults});
|
||||
reporter.reportSuiteResults({description: "Mixer", results: emptyResults});
|
||||
|
||||
expect(reporter.suiteResults[0].description).toEqual('Oven');
|
||||
expect(reporter.suiteResults[1].description).toEqual('Mixer');
|
||||
});
|
||||
|
||||
it("creates a description out of the current suite and any parent suites", function() {
|
||||
var grandparentSuite = {
|
||||
description: "My house",
|
||||
results: emptyResults
|
||||
};
|
||||
var parentSuite = {
|
||||
description: "kitchen",
|
||||
parentSuite: grandparentSuite,
|
||||
results: emptyResults
|
||||
};
|
||||
reporter.reportSuiteResults({ description: "oven", parentSuite: parentSuite, results: emptyResults });
|
||||
|
||||
expect(reporter.suiteResults[0].description).toEqual("My house kitchen oven");
|
||||
});
|
||||
|
||||
it("gathers failing spec results from the suite - the spec must have a description.", function() {
|
||||
reporter.reportSuiteResults({description:"Oven",
|
||||
results: function() {
|
||||
return {
|
||||
items_:[
|
||||
{ failedCount: 0, description: "specOne" },
|
||||
{ failedCount: 99, description: "specTwo" },
|
||||
{ failedCount: 0, description: "specThree" },
|
||||
{ failedCount: 88, description: "specFour" },
|
||||
{ failedCount: 3 }
|
||||
]
|
||||
};
|
||||
}});
|
||||
|
||||
expect(reporter.suiteResults[0].failedSpecResults).
|
||||
toEqual([
|
||||
{ failedCount: 99, description: "specTwo" },
|
||||
{ failedCount: 88, description: "specFour" }
|
||||
]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('and finishes', function() {
|
||||
|
||||
describe('when reporting spec failure information', function() {
|
||||
|
||||
it("prints suite and spec descriptions together as a sentence", function() {
|
||||
reporter.suiteResults = [
|
||||
{description:"The oven", failedSpecResults:[
|
||||
{description:"heats up", items_:[]},
|
||||
{description:"cleans itself", items_:[]}
|
||||
]},
|
||||
{description:"The mixer", failedSpecResults:[
|
||||
{description:"blends things together", items_:[]}
|
||||
]}
|
||||
];
|
||||
|
||||
reporter.reportRunnerResults(failingRun);
|
||||
|
||||
expect(out.getOutput()).toContain("The oven heats up");
|
||||
expect(out.getOutput()).toContain("The oven cleans itself");
|
||||
expect(out.getOutput()).toContain("The mixer blends things together");
|
||||
});
|
||||
|
||||
it("prints stack trace of spec failure", function() {
|
||||
reporter.suiteResults = [
|
||||
{description:"The oven", failedSpecResults:[
|
||||
{description:"heats up",
|
||||
items_:[
|
||||
{trace:{stack:"stack trace one"}},
|
||||
{trace:{stack:"stack trace two"}}
|
||||
]}
|
||||
]}
|
||||
];
|
||||
|
||||
reporter.reportRunnerResults(failingRun);
|
||||
|
||||
expect(out.getOutput()).toContain("The oven heats up");
|
||||
expect(out.getOutput()).toContain("stack trace one");
|
||||
expect(out.getOutput()).toContain("stack trace two");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('when reporting the execution time', function() {
|
||||
|
||||
it("prints the full finished message", function() {
|
||||
reporter.now = function() {
|
||||
return 1000;
|
||||
};
|
||||
reporter.reportRunnerStarting();
|
||||
reporter.now = function() {
|
||||
return 1777;
|
||||
};
|
||||
reporter.reportRunnerResults(failingRun);
|
||||
expect(out.getOutput()).toContain("Finished in 0.777 seconds");
|
||||
});
|
||||
|
||||
it("prints round time numbers correctly", function() {
|
||||
function run(startTime, endTime) {
|
||||
out.clear();
|
||||
reporter.runnerStartTime = startTime;
|
||||
reporter.now = function() {
|
||||
return endTime;
|
||||
};
|
||||
reporter.reportRunnerResults(passingRun);
|
||||
}
|
||||
|
||||
run(1000, 11000);
|
||||
expect(out.getOutput()).toContain("10 seconds");
|
||||
|
||||
run(1000, 2000);
|
||||
expect(out.getOutput()).toContain("1 seconds");
|
||||
|
||||
run(1000, 1100);
|
||||
expect(out.getOutput()).toContain("0.1 seconds");
|
||||
|
||||
run(1000, 1010);
|
||||
expect(out.getOutput()).toContain("0.01 seconds");
|
||||
|
||||
run(1000, 1001);
|
||||
expect(out.getOutput()).toContain("0.001 seconds");
|
||||
});
|
||||
});
|
||||
|
||||
describe("when reporting the results summary", function() {
|
||||
it("prints statistics in green if there were no failures", function() {
|
||||
reporter.reportRunnerResults({
|
||||
specs: function() {
|
||||
return [null, null, null];
|
||||
},
|
||||
results:function() {
|
||||
return {items_: [null, null, null], totalCount: 7, failedCount: 0};
|
||||
}
|
||||
});
|
||||
expect(out.getOutput()).
|
||||
toContain("3 specs, 0 failures");
|
||||
});
|
||||
|
||||
it("prints statistics in red if there was a failure", function() {
|
||||
reporter.reportRunnerResults({
|
||||
specs: function() {
|
||||
return [null, null, null];
|
||||
},
|
||||
results:function() {
|
||||
return {items_: [null, null, null], totalCount: 7, failedCount: 3};
|
||||
}
|
||||
});
|
||||
expect(out.getOutput()).
|
||||
toContain("3 specs, 3 failures");
|
||||
});
|
||||
|
||||
it("handles pluralization with 1's ones appropriately", function() {
|
||||
reporter.reportRunnerResults({
|
||||
specs: function() {
|
||||
return [null];
|
||||
},
|
||||
results:function() {
|
||||
return {items_: [null], totalCount: 1, failedCount: 1};
|
||||
}
|
||||
});
|
||||
expect(out.getOutput()).
|
||||
toContain("1 spec, 1 failure");
|
||||
});
|
||||
});
|
||||
|
||||
describe("done callback", function() {
|
||||
it("calls back when done", function() {
|
||||
expect(done).toBeFalsy();
|
||||
reporter.reportRunnerResults({
|
||||
specs: function() {
|
||||
return [null, null, null];
|
||||
},
|
||||
results:function() {
|
||||
return {items_: [null, null, null], totalCount: 7, failedCount: 0};
|
||||
}
|
||||
});
|
||||
expect(done).toBeTruthy();
|
||||
});
|
||||
});
|
||||
it('calls it with false if there are suite failures', function() {
|
||||
reporter.specDone({status: "passed"});
|
||||
reporter.suiteDone({failedExpectations: [{ message: 'bananas' }] });
|
||||
reporter.jasmineDone();
|
||||
expect(onComplete).toHaveBeenCalledWith(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("with color", function() {
|
||||
it("reports that the suite has started to the console", function() {
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print,
|
||||
showColors: true
|
||||
});
|
||||
|
||||
reporter.jasmineStarted();
|
||||
|
||||
expect(out.getOutput()).toEqual("Started\n");
|
||||
});
|
||||
|
||||
it("reports a passing spec as a dot", function() {
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print,
|
||||
showColors: true
|
||||
});
|
||||
|
||||
reporter.specDone({status: "passed"});
|
||||
|
||||
expect(out.getOutput()).toEqual("\x1B[32m.\x1B[0m");
|
||||
});
|
||||
|
||||
it("does not report a disabled spec", function() {
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print,
|
||||
showColors: true
|
||||
});
|
||||
|
||||
reporter.specDone({status: 'disabled'});
|
||||
|
||||
expect(out.getOutput()).toEqual("");
|
||||
});
|
||||
|
||||
it("reports a failing spec as an 'F'", function() {
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print,
|
||||
showColors: true
|
||||
});
|
||||
|
||||
reporter.specDone({status: 'failed'});
|
||||
|
||||
expect(out.getOutput()).toEqual("\x1B[31mF\x1B[0m");
|
||||
});
|
||||
|
||||
it("displays all afterAll exceptions", function() {
|
||||
var reporter = new jasmineUnderTest.ConsoleReporter({
|
||||
print: out.print,
|
||||
showColors: true
|
||||
});
|
||||
|
||||
reporter.suiteDone({ failedExpectations: [{ message: 'After All Exception' }] });
|
||||
reporter.suiteDone({ failedExpectations: [{ message: 'Some Other Exception' }] });
|
||||
reporter.jasmineDone();
|
||||
|
||||
expect(out.getOutput()).toMatch(/After All Exception/);
|
||||
expect(out.getOutput()).toMatch(/Some Other Exception/);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
describe("base.js", function() {
|
||||
describe("jasmine.MessageResult", function() {
|
||||
it("#toString should pretty-print and concatenate each part of the message", function() {
|
||||
var values = ["log", "message", 123, {key: "value"}, "FTW!"];
|
||||
var messageResult = new jasmine.MessageResult(values);
|
||||
expect(messageResult.toString()).toEqual("log message 123 { key : 'value' } FTW!");
|
||||
});
|
||||
});
|
||||
|
||||
describe("jasmine.log", function() {
|
||||
it("should accept n arguments", function() {
|
||||
spyOn(jasmine.getEnv().currentSpec, 'log');
|
||||
jasmine.log(1, 2, 3);
|
||||
expect(jasmine.getEnv().currentSpec.log).toHaveBeenCalledWith(1, 2, 3);
|
||||
});
|
||||
});
|
||||
|
||||
describe("jasmine.getGlobal", function() {
|
||||
it("should return the global object", function() {
|
||||
var globalObject = (function() {
|
||||
return this;
|
||||
})();
|
||||
|
||||
expect(jasmine.getGlobal()).toBe(globalObject);
|
||||
});
|
||||
});
|
||||
});
|
||||
120
spec/core/CallTrackerSpec.js
Normal file
120
spec/core/CallTrackerSpec.js
Normal file
@@ -0,0 +1,120 @@
|
||||
describe("CallTracker", function() {
|
||||
it("tracks that it was called when executed", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
|
||||
expect(callTracker.any()).toBe(false);
|
||||
|
||||
callTracker.track();
|
||||
|
||||
expect(callTracker.any()).toBe(true);
|
||||
});
|
||||
|
||||
it("tracks that number of times that it is executed", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
|
||||
expect(callTracker.count()).toEqual(0);
|
||||
|
||||
callTracker.track();
|
||||
|
||||
expect(callTracker.count()).toEqual(1);
|
||||
});
|
||||
|
||||
it("tracks the params from each execution", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
|
||||
callTracker.track({object: void 0, args: []});
|
||||
callTracker.track({object: {}, args: [0, "foo"]});
|
||||
|
||||
expect(callTracker.argsFor(0)).toEqual([]);
|
||||
|
||||
expect(callTracker.argsFor(1)).toEqual([0, "foo"]);
|
||||
});
|
||||
|
||||
it("returns any empty array when there was no call", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
|
||||
expect(callTracker.argsFor(0)).toEqual([]);
|
||||
});
|
||||
|
||||
it("allows access for the arguments for all calls", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
|
||||
callTracker.track({object: {}, args: []});
|
||||
callTracker.track({object: {}, args: [0, "foo"]});
|
||||
|
||||
expect(callTracker.allArgs()).toEqual([[], [0, "foo"]]);
|
||||
});
|
||||
|
||||
it("tracks the context and arguments for each call", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
|
||||
callTracker.track({object: {}, args: []});
|
||||
callTracker.track({object: {}, args: [0, "foo"]});
|
||||
|
||||
expect(callTracker.all()[0]).toEqual({object: {}, args: []});
|
||||
|
||||
expect(callTracker.all()[1]).toEqual({object: {}, args: [0, "foo"]});
|
||||
});
|
||||
|
||||
it("simplifies access to the arguments for the last (most recent) call", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
|
||||
callTracker.track();
|
||||
callTracker.track({object: {}, args: [0, "foo"]});
|
||||
|
||||
expect(callTracker.mostRecent()).toEqual({
|
||||
object: {},
|
||||
args: [0, "foo"]
|
||||
});
|
||||
});
|
||||
|
||||
it("returns a useful falsy value when there isn't a last (most recent) call", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
|
||||
expect(callTracker.mostRecent()).toBeFalsy();
|
||||
});
|
||||
|
||||
it("simplifies access to the arguments for the first (oldest) call", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
|
||||
callTracker.track({object: {}, args: [0, "foo"]});
|
||||
|
||||
expect(callTracker.first()).toEqual({object: {}, args: [0, "foo"]})
|
||||
});
|
||||
|
||||
it("returns a useful falsy value when there isn't a first (oldest) call", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
|
||||
expect(callTracker.first()).toBeFalsy();
|
||||
});
|
||||
|
||||
|
||||
it("allows the tracking to be reset", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
|
||||
callTracker.track();
|
||||
callTracker.track({object: {}, args: [0, "foo"]});
|
||||
callTracker.reset();
|
||||
|
||||
expect(callTracker.any()).toBe(false);
|
||||
expect(callTracker.count()).toEqual(0);
|
||||
expect(callTracker.argsFor(0)).toEqual([]);
|
||||
expect(callTracker.all()).toEqual([]);
|
||||
expect(callTracker.mostRecent()).toBeFalsy();
|
||||
});
|
||||
|
||||
it("allows object arguments to be shallow cloned", function() {
|
||||
var callTracker = new jasmineUnderTest.CallTracker();
|
||||
callTracker.saveArgumentsByValue();
|
||||
|
||||
var objectArg = {"foo": "bar"},
|
||||
arrayArg = ["foo", "bar"];
|
||||
|
||||
callTracker.track({object: {}, args: [objectArg, arrayArg, false, undefined, null, NaN, "", 0, 1.0]});
|
||||
|
||||
expect(callTracker.mostRecent().args[0]).not.toBe(objectArg);
|
||||
expect(callTracker.mostRecent().args[0]).toEqual(objectArg);
|
||||
expect(callTracker.mostRecent().args[1]).not.toBe(arrayArg);
|
||||
expect(callTracker.mostRecent().args[1]).toEqual(arrayArg);
|
||||
});
|
||||
});
|
||||
53
spec/core/ClearStackSpec.js
Normal file
53
spec/core/ClearStackSpec.js
Normal file
@@ -0,0 +1,53 @@
|
||||
describe("ClearStack", function() {
|
||||
it("works in an integrationy way", function(done) {
|
||||
var clearStack = jasmineUnderTest.getClearStack(jasmineUnderTest.getGlobal());
|
||||
|
||||
clearStack(function() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("uses setImmediate when available", function() {
|
||||
var setImmediate = jasmine.createSpy('setImmediate').and.callFake(function(fn) { fn() }),
|
||||
global = { setImmediate: setImmediate },
|
||||
clearStack = jasmineUnderTest.getClearStack(global),
|
||||
called = false;
|
||||
|
||||
clearStack(function() {
|
||||
called = true;
|
||||
});
|
||||
|
||||
expect(called).toBe(true);
|
||||
expect(setImmediate).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("uses MessageChannels when available", function() {
|
||||
var fakeChannel = {
|
||||
port1: {},
|
||||
port2: { postMessage: function() { fakeChannel.port1.onmessage(); } }
|
||||
},
|
||||
global = { MessageChannel: function() { return fakeChannel; } },
|
||||
clearStack = jasmineUnderTest.getClearStack(global),
|
||||
called = false;
|
||||
|
||||
clearStack(function() {
|
||||
called = true;
|
||||
});
|
||||
|
||||
expect(called).toBe(true);
|
||||
});
|
||||
|
||||
it("falls back to setTimeout", function() {
|
||||
var setTimeout = jasmine.createSpy('setTimeout').and.callFake(function(fn) { fn() }),
|
||||
global = { setTimeout: setTimeout },
|
||||
clearStack = jasmineUnderTest.getClearStack(global),
|
||||
called = false;
|
||||
|
||||
clearStack(function() {
|
||||
called = true;
|
||||
});
|
||||
|
||||
expect(called).toBe(true);
|
||||
expect(setTimeout).toHaveBeenCalledWith(jasmine.any(Function), 0);
|
||||
});
|
||||
});
|
||||
682
spec/core/ClockSpec.js
Normal file
682
spec/core/ClockSpec.js
Normal file
@@ -0,0 +1,682 @@
|
||||
describe("Clock", function() {
|
||||
|
||||
it("does not replace setTimeout until it is installed", function() {
|
||||
var fakeSetTimeout = jasmine.createSpy("global setTimeout"),
|
||||
fakeGlobal = { setTimeout: fakeSetTimeout },
|
||||
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction"]),
|
||||
delayedFn = jasmine.createSpy("delayedFn"),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
fakeGlobal.setTimeout(delayedFn, 0);
|
||||
|
||||
expect(fakeSetTimeout).toHaveBeenCalledWith(delayedFn, 0);
|
||||
expect(delayedFunctionScheduler.scheduleFunction).not.toHaveBeenCalled();
|
||||
|
||||
fakeSetTimeout.calls.reset();
|
||||
|
||||
clock.install();
|
||||
fakeGlobal.setTimeout(delayedFn, 0);
|
||||
|
||||
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalled();
|
||||
expect(fakeSetTimeout).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not replace clearTimeout until it is installed", function() {
|
||||
var fakeClearTimeout = jasmine.createSpy("global cleartimeout"),
|
||||
fakeGlobal = { clearTimeout: fakeClearTimeout },
|
||||
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["removeFunctionWithId"]),
|
||||
delayedFn = jasmine.createSpy("delayedFn"),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
fakeGlobal.clearTimeout("foo");
|
||||
|
||||
expect(fakeClearTimeout).toHaveBeenCalledWith("foo");
|
||||
expect(delayedFunctionScheduler.removeFunctionWithId).not.toHaveBeenCalled();
|
||||
|
||||
fakeClearTimeout.calls.reset();
|
||||
|
||||
clock.install();
|
||||
fakeGlobal.clearTimeout("foo");
|
||||
|
||||
expect(delayedFunctionScheduler.removeFunctionWithId).toHaveBeenCalled();
|
||||
expect(fakeClearTimeout).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not replace setInterval until it is installed", function() {
|
||||
var fakeSetInterval = jasmine.createSpy("global setInterval"),
|
||||
fakeGlobal = { setInterval: fakeSetInterval },
|
||||
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction"]),
|
||||
delayedFn = jasmine.createSpy("delayedFn"),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
fakeGlobal.setInterval(delayedFn, 0);
|
||||
|
||||
expect(fakeSetInterval).toHaveBeenCalledWith(delayedFn, 0);
|
||||
expect(delayedFunctionScheduler.scheduleFunction).not.toHaveBeenCalled();
|
||||
|
||||
fakeSetInterval.calls.reset();
|
||||
|
||||
clock.install();
|
||||
fakeGlobal.setInterval(delayedFn, 0);
|
||||
|
||||
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalled();
|
||||
expect(fakeSetInterval).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not replace clearInterval until it is installed", function() {
|
||||
var fakeClearInterval = jasmine.createSpy("global clearinterval"),
|
||||
fakeGlobal = { clearInterval: fakeClearInterval },
|
||||
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["removeFunctionWithId"]),
|
||||
delayedFn = jasmine.createSpy("delayedFn"),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
fakeGlobal.clearInterval("foo");
|
||||
|
||||
expect(fakeClearInterval).toHaveBeenCalledWith("foo");
|
||||
expect(delayedFunctionScheduler.removeFunctionWithId).not.toHaveBeenCalled();
|
||||
|
||||
fakeClearInterval.calls.reset();
|
||||
|
||||
clock.install();
|
||||
fakeGlobal.clearInterval("foo");
|
||||
|
||||
expect(delayedFunctionScheduler.removeFunctionWithId).toHaveBeenCalled();
|
||||
expect(fakeClearInterval).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not install if the current setTimeout is not the original function on the global", function() {
|
||||
var originalFakeSetTimeout = function() {},
|
||||
replacedSetTimeout = function() {},
|
||||
fakeGlobal = { setTimeout: originalFakeSetTimeout },
|
||||
delayedFunctionSchedulerFactory = jasmine.createSpy('delayedFunctionSchedulerFactory'),
|
||||
mockDate = {},
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate);
|
||||
|
||||
fakeGlobal.setTimeout = replacedSetTimeout;
|
||||
|
||||
expect(function() {
|
||||
clock.install();
|
||||
}).toThrowError(/unable to install/);
|
||||
|
||||
expect(delayedFunctionSchedulerFactory).not.toHaveBeenCalled();
|
||||
expect(fakeGlobal.setTimeout).toBe(replacedSetTimeout);
|
||||
});
|
||||
|
||||
it("does not install if the current clearTimeout is not the original function on the global", function() {
|
||||
var originalFakeClearTimeout = function() {},
|
||||
replacedClearTimeout = function() {},
|
||||
fakeGlobal = { clearTimeout: originalFakeClearTimeout },
|
||||
delayedFunctionSchedulerFactory = jasmine.createSpy('delayedFunctionSchedulerFactory'),
|
||||
mockDate = {},
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate);
|
||||
|
||||
fakeGlobal.clearTimeout = replacedClearTimeout;
|
||||
|
||||
expect(function() {
|
||||
clock.install();
|
||||
}).toThrowError(/unable to install/);
|
||||
|
||||
expect(delayedFunctionSchedulerFactory).not.toHaveBeenCalled();
|
||||
expect(fakeGlobal.clearTimeout).toBe(replacedClearTimeout);
|
||||
});
|
||||
|
||||
it("does not install if the current setInterval is not the original function on the global", function() {
|
||||
var originalFakeSetInterval = function() {},
|
||||
replacedSetInterval = function() {},
|
||||
fakeGlobal = { setInterval: originalFakeSetInterval },
|
||||
delayedFunctionSchedulerFactory = jasmine.createSpy('delayedFunctionSchedulerFactory'),
|
||||
mockDate = {},
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate);
|
||||
|
||||
fakeGlobal.setInterval = replacedSetInterval;
|
||||
|
||||
expect(function() {
|
||||
clock.install();
|
||||
}).toThrowError(/unable to install/);
|
||||
|
||||
expect(delayedFunctionSchedulerFactory).not.toHaveBeenCalled();
|
||||
expect(fakeGlobal.setInterval).toBe(replacedSetInterval);
|
||||
});
|
||||
|
||||
it("does not install if the current clearInterval is not the original function on the global", function() {
|
||||
var originalFakeClearInterval = function() {},
|
||||
replacedClearInterval = function() {},
|
||||
fakeGlobal = { clearInterval: originalFakeClearInterval },
|
||||
delayedFunctionSchedulerFactory = jasmine.createSpy('delayedFunctionSchedulerFactory'),
|
||||
mockDate = {},
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate);
|
||||
|
||||
fakeGlobal.clearInterval = replacedClearInterval;
|
||||
|
||||
expect(function() {
|
||||
clock.install();
|
||||
}).toThrowError(/unable to install/);
|
||||
|
||||
expect(delayedFunctionSchedulerFactory).not.toHaveBeenCalled();
|
||||
expect(fakeGlobal.clearInterval).toBe(replacedClearInterval);
|
||||
});
|
||||
|
||||
it("replaces the global timer functions on uninstall", function() {
|
||||
var fakeSetTimeout = jasmine.createSpy("global setTimeout"),
|
||||
fakeClearTimeout = jasmine.createSpy("global clearTimeout"),
|
||||
fakeSetInterval = jasmine.createSpy("global setInterval"),
|
||||
fakeClearInterval = jasmine.createSpy("global clearInterval"),
|
||||
fakeGlobal = {
|
||||
setTimeout: fakeSetTimeout,
|
||||
clearTimeout: fakeClearTimeout,
|
||||
setInterval: fakeSetInterval,
|
||||
clearInterval: fakeClearInterval
|
||||
},
|
||||
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction", "reset"]),
|
||||
delayedFn = jasmine.createSpy("delayedFn"),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
clock.install();
|
||||
clock.uninstall();
|
||||
fakeGlobal.setTimeout(delayedFn, 0);
|
||||
fakeGlobal.clearTimeout("foo");
|
||||
fakeGlobal.setInterval(delayedFn, 10);
|
||||
fakeGlobal.clearInterval("bar");
|
||||
|
||||
expect(fakeSetTimeout).toHaveBeenCalledWith(delayedFn, 0);
|
||||
expect(fakeClearTimeout).toHaveBeenCalledWith("foo");
|
||||
expect(fakeSetInterval).toHaveBeenCalledWith(delayedFn, 10);
|
||||
expect(fakeClearInterval).toHaveBeenCalledWith("bar");
|
||||
expect(delayedFunctionScheduler.scheduleFunction).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("can be installed for the duration of a passed in function and uninstalled when done", function() {
|
||||
var fakeSetTimeout = jasmine.createSpy("global setTimeout"),
|
||||
fakeClearTimeout = jasmine.createSpy("global clearTimeout"),
|
||||
fakeSetInterval = jasmine.createSpy("global setInterval"),
|
||||
fakeClearInterval = jasmine.createSpy("global clearInterval"),
|
||||
fakeGlobal = {
|
||||
setTimeout: fakeSetTimeout,
|
||||
clearTimeout: fakeClearTimeout,
|
||||
setInterval: fakeSetInterval,
|
||||
clearInterval: fakeClearInterval
|
||||
},
|
||||
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction", "reset", "removeFunctionWithId"]),
|
||||
delayedFn = jasmine.createSpy("delayedFn"),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate),
|
||||
passedFunctionCalled = false;
|
||||
|
||||
clock.withMock(function() {
|
||||
fakeGlobal.setTimeout(delayedFn, 0);
|
||||
fakeGlobal.clearTimeout("foo");
|
||||
fakeGlobal.setInterval(delayedFn, 10);
|
||||
fakeGlobal.clearInterval("bar");
|
||||
passedFunctionCalled = true;
|
||||
});
|
||||
|
||||
expect(passedFunctionCalled).toBe(true);
|
||||
|
||||
expect(fakeSetTimeout).not.toHaveBeenCalled();
|
||||
expect(fakeClearTimeout).not.toHaveBeenCalled();
|
||||
expect(fakeSetInterval).not.toHaveBeenCalled();
|
||||
expect(fakeClearInterval).not.toHaveBeenCalled();
|
||||
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalled();
|
||||
|
||||
delayedFunctionScheduler.scheduleFunction.calls.reset();
|
||||
|
||||
fakeGlobal.setTimeout(delayedFn, 0);
|
||||
fakeGlobal.clearTimeout("foo");
|
||||
fakeGlobal.setInterval(delayedFn, 10);
|
||||
fakeGlobal.clearInterval("bar");
|
||||
|
||||
expect(fakeSetTimeout).toHaveBeenCalledWith(delayedFn, 0);
|
||||
expect(fakeClearTimeout).toHaveBeenCalledWith("foo");
|
||||
expect(fakeSetInterval).toHaveBeenCalledWith(delayedFn, 10);
|
||||
expect(fakeClearInterval).toHaveBeenCalledWith("bar");
|
||||
expect(delayedFunctionScheduler.scheduleFunction).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("can be installed for the duration of a passed in function and uninstalled if an error is thrown", function() {
|
||||
var fakeSetTimeout = jasmine.createSpy("global setTimeout"),
|
||||
fakeClearTimeout = jasmine.createSpy("global clearTimeout"),
|
||||
fakeSetInterval = jasmine.createSpy("global setInterval"),
|
||||
fakeClearInterval = jasmine.createSpy("global clearInterval"),
|
||||
fakeGlobal = {
|
||||
setTimeout: fakeSetTimeout,
|
||||
clearTimeout: fakeClearTimeout,
|
||||
setInterval: fakeSetInterval,
|
||||
clearInterval: fakeClearInterval
|
||||
},
|
||||
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction", "reset", "removeFunctionWithId"]),
|
||||
delayedFn = jasmine.createSpy("delayedFn"),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate),
|
||||
passedFunctionCalled = false;
|
||||
|
||||
expect(function() {
|
||||
clock.withMock(function() {
|
||||
fakeGlobal.setTimeout(delayedFn, 0);
|
||||
fakeGlobal.clearTimeout("foo");
|
||||
fakeGlobal.setInterval(delayedFn, 10);
|
||||
fakeGlobal.clearInterval("bar");
|
||||
passedFunctionCalled = true;
|
||||
throw 'oops';
|
||||
});
|
||||
}).toThrow('oops');
|
||||
|
||||
expect(passedFunctionCalled).toBe(true);
|
||||
|
||||
expect(fakeSetTimeout).not.toHaveBeenCalled();
|
||||
expect(fakeClearTimeout).not.toHaveBeenCalled();
|
||||
expect(fakeSetInterval).not.toHaveBeenCalled();
|
||||
expect(fakeClearInterval).not.toHaveBeenCalled();
|
||||
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalled();
|
||||
|
||||
delayedFunctionScheduler.scheduleFunction.calls.reset();
|
||||
|
||||
fakeGlobal.setTimeout(delayedFn, 0);
|
||||
fakeGlobal.clearTimeout("foo");
|
||||
fakeGlobal.setInterval(delayedFn, 10);
|
||||
fakeGlobal.clearInterval("bar");
|
||||
|
||||
expect(fakeSetTimeout).toHaveBeenCalledWith(delayedFn, 0);
|
||||
expect(fakeClearTimeout).toHaveBeenCalledWith("foo");
|
||||
expect(fakeSetInterval).toHaveBeenCalledWith(delayedFn, 10);
|
||||
expect(fakeClearInterval).toHaveBeenCalledWith("bar");
|
||||
expect(delayedFunctionScheduler.scheduleFunction).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("schedules the delayed function (via setTimeout) with the fake timer", function() {
|
||||
var fakeSetTimeout = jasmine.createSpy('setTimeout'),
|
||||
scheduleFunction = jasmine.createSpy('scheduleFunction'),
|
||||
delayedFunctionScheduler = { scheduleFunction: scheduleFunction },
|
||||
fakeGlobal = { setTimeout: fakeSetTimeout },
|
||||
delayedFn = jasmine.createSpy('delayedFn'),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
clock.install();
|
||||
clock.setTimeout(delayedFn, 0, 'a', 'b');
|
||||
|
||||
expect(fakeSetTimeout).not.toHaveBeenCalled();
|
||||
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalledWith(delayedFn, 0, ['a', 'b']);
|
||||
});
|
||||
|
||||
it("returns an id for the delayed function", function() {
|
||||
var fakeSetTimeout = jasmine.createSpy('setTimeout'),
|
||||
scheduleId = 123,
|
||||
scheduleFunction = jasmine.createSpy('scheduleFunction').and.returnValue(scheduleId),
|
||||
delayedFunctionScheduler = {scheduleFunction: scheduleFunction},
|
||||
fakeGlobal = { setTimeout: fakeSetTimeout },
|
||||
delayedFn = jasmine.createSpy('delayedFn'),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate),
|
||||
timeoutId;
|
||||
|
||||
clock.install();
|
||||
timeoutId = clock.setTimeout(delayedFn, 0);
|
||||
|
||||
expect(timeoutId).toEqual(123);
|
||||
});
|
||||
|
||||
it("clears the scheduled function with the scheduler", function() {
|
||||
var fakeClearTimeout = jasmine.createSpy('clearTimeout'),
|
||||
delayedFunctionScheduler = jasmine.createSpyObj('delayedFunctionScheduler', ['removeFunctionWithId']),
|
||||
fakeGlobal = { setTimeout: fakeClearTimeout },
|
||||
delayedFn = jasmine.createSpy('delayedFn'),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
clock.install();
|
||||
clock.clearTimeout(123);
|
||||
|
||||
expect(fakeClearTimeout).not.toHaveBeenCalled();
|
||||
expect(delayedFunctionScheduler.removeFunctionWithId).toHaveBeenCalledWith(123);
|
||||
});
|
||||
|
||||
it("schedules the delayed function with the fake timer", function() {
|
||||
var fakeSetInterval = jasmine.createSpy('setInterval'),
|
||||
scheduleFunction = jasmine.createSpy('scheduleFunction'),
|
||||
delayedFunctionScheduler = {scheduleFunction: scheduleFunction},
|
||||
fakeGlobal = { setInterval: fakeSetInterval },
|
||||
delayedFn = jasmine.createSpy('delayedFn'),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
clock.install();
|
||||
clock.setInterval(delayedFn, 0, 'a', 'b');
|
||||
|
||||
expect(fakeSetInterval).not.toHaveBeenCalled();
|
||||
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalledWith(delayedFn, 0, ['a', 'b'], true);
|
||||
});
|
||||
|
||||
it("returns an id for the delayed function", function() {
|
||||
var fakeSetInterval = jasmine.createSpy('setInterval'),
|
||||
scheduleId = 123,
|
||||
scheduleFunction = jasmine.createSpy('scheduleFunction').and.returnValue(scheduleId),
|
||||
delayedFunctionScheduler = {scheduleFunction: scheduleFunction},
|
||||
fakeGlobal = { setInterval: fakeSetInterval },
|
||||
delayedFn = jasmine.createSpy('delayedFn'),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate),
|
||||
intervalId;
|
||||
|
||||
clock.install();
|
||||
intervalId = clock.setInterval(delayedFn, 0);
|
||||
|
||||
expect(intervalId).toEqual(123);
|
||||
});
|
||||
|
||||
it("clears the scheduled function with the scheduler", function() {
|
||||
var clearInterval = jasmine.createSpy('clearInterval'),
|
||||
delayedFunctionScheduler = jasmine.createSpyObj('delayedFunctionScheduler', ['removeFunctionWithId']),
|
||||
fakeGlobal = { setInterval: clearInterval },
|
||||
delayedFn = jasmine.createSpy('delayedFn'),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
clock.install();
|
||||
clock.clearInterval(123);
|
||||
|
||||
expect(clearInterval).not.toHaveBeenCalled();
|
||||
expect(delayedFunctionScheduler.removeFunctionWithId).toHaveBeenCalledWith(123);
|
||||
});
|
||||
|
||||
it("gives you a friendly reminder if the Clock is not installed and you tick", function() {
|
||||
var clock = new jasmineUnderTest.Clock({}, jasmine.createSpyObj('delayedFunctionScheduler', ['tick']));
|
||||
expect(function() {
|
||||
clock.tick(50);
|
||||
}).toThrow();
|
||||
});
|
||||
|
||||
it("on IE < 9, fails if extra args are passed to fake clock", function() {
|
||||
//fail, because this would break in IE9.
|
||||
var fakeSetTimeout = jasmine.createSpy('setTimeout'),
|
||||
fakeSetInterval = jasmine.createSpy('setInterval'),
|
||||
delayedFunctionScheduler = jasmine.createSpyObj('delayedFunctionScheduler', ['scheduleFunction']),
|
||||
fn = jasmine.createSpy('fn'),
|
||||
fakeGlobal = {
|
||||
setTimeout: fakeSetTimeout,
|
||||
setInterval: fakeSetInterval
|
||||
},
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
fakeSetTimeout.apply = null;
|
||||
fakeSetInterval.apply = null;
|
||||
|
||||
clock.install();
|
||||
|
||||
clock.setTimeout(fn, 0);
|
||||
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalledWith(fn, 0, []);
|
||||
expect(function() {
|
||||
clock.setTimeout(fn, 0, 'extra');
|
||||
}).toThrow();
|
||||
|
||||
clock.setInterval(fn, 0);
|
||||
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalledWith(fn, 0, [], true);
|
||||
expect(function() {
|
||||
clock.setInterval(fn, 0, 'extra');
|
||||
}).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe("Clock (acceptance)", function() {
|
||||
it("can run setTimeouts/setIntervals synchronously", function() {
|
||||
var delayedFn1 = jasmine.createSpy('delayedFn1'),
|
||||
delayedFn2 = jasmine.createSpy('delayedFn2'),
|
||||
delayedFn3 = jasmine.createSpy('delayedFn3'),
|
||||
recurring1 = jasmine.createSpy('recurring1'),
|
||||
delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
clock.install();
|
||||
|
||||
clock.setTimeout(delayedFn1, 0);
|
||||
var intervalId = clock.setInterval(recurring1, 50);
|
||||
clock.setTimeout(delayedFn2, 100);
|
||||
clock.setTimeout(delayedFn3, 200);
|
||||
|
||||
expect(delayedFn1).not.toHaveBeenCalled();
|
||||
expect(delayedFn2).not.toHaveBeenCalled();
|
||||
expect(delayedFn3).not.toHaveBeenCalled();
|
||||
|
||||
clock.tick(0);
|
||||
|
||||
expect(delayedFn1).toHaveBeenCalled();
|
||||
expect(delayedFn2).not.toHaveBeenCalled();
|
||||
expect(delayedFn3).not.toHaveBeenCalled();
|
||||
|
||||
clock.tick(50);
|
||||
|
||||
expect(recurring1).toHaveBeenCalled();
|
||||
expect(recurring1.calls.count()).toBe(1);
|
||||
expect(delayedFn2).not.toHaveBeenCalled();
|
||||
expect(delayedFn3).not.toHaveBeenCalled();
|
||||
|
||||
clock.tick(50);
|
||||
|
||||
expect(recurring1.calls.count()).toBe(2);
|
||||
expect(delayedFn2).toHaveBeenCalled();
|
||||
expect(delayedFn3).not.toHaveBeenCalled();
|
||||
|
||||
clock.tick(100);
|
||||
|
||||
expect(recurring1.calls.count()).toBe(4);
|
||||
expect(delayedFn3).toHaveBeenCalled();
|
||||
|
||||
clock.clearInterval(intervalId);
|
||||
clock.tick(50);
|
||||
|
||||
expect(recurring1.calls.count()).toBe(4);
|
||||
});
|
||||
|
||||
it("can clear a previously set timeout", function() {
|
||||
var clearedFn = jasmine.createSpy('clearedFn'),
|
||||
delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate),
|
||||
timeoutId;
|
||||
|
||||
clock.install();
|
||||
|
||||
timeoutId = clock.setTimeout(clearedFn, 100);
|
||||
expect(clearedFn).not.toHaveBeenCalled();
|
||||
|
||||
clock.clearTimeout(timeoutId);
|
||||
clock.tick(100);
|
||||
|
||||
expect(clearedFn).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("can clear a previously set interval using that interval's handler", function() {
|
||||
var spy = jasmine.createSpy('spy'),
|
||||
delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock({setInterval: function() {}}, function () { return delayedFunctionScheduler; }, mockDate),
|
||||
intervalId;
|
||||
|
||||
clock.install();
|
||||
|
||||
intervalId = clock.setInterval(function() {
|
||||
spy();
|
||||
clock.clearInterval(intervalId);
|
||||
}, 100);
|
||||
clock.tick(200);
|
||||
|
||||
expect(spy.calls.count()).toEqual(1);
|
||||
});
|
||||
|
||||
it("correctly schedules functions after the Clock has advanced", function() {
|
||||
var delayedFn1 = jasmine.createSpy('delayedFn1'),
|
||||
delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
clock.install();
|
||||
|
||||
clock.tick(100);
|
||||
clock.setTimeout(delayedFn1, 10, ['some', 'arg']);
|
||||
clock.tick(5);
|
||||
expect(delayedFn1).not.toHaveBeenCalled();
|
||||
clock.tick(5);
|
||||
expect(delayedFn1).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("correctly schedules functions while the Clock is advancing", function() {
|
||||
var delayedFn1 = jasmine.createSpy('delayedFn1'),
|
||||
delayedFn2 = jasmine.createSpy('delayedFn2'),
|
||||
delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
delayedFn1.and.callFake(function() { clock.setTimeout(delayedFn2, 0); });
|
||||
clock.install();
|
||||
clock.setTimeout(delayedFn1, 5);
|
||||
|
||||
clock.tick(5);
|
||||
expect(delayedFn1).toHaveBeenCalled();
|
||||
expect(delayedFn2).not.toHaveBeenCalled();
|
||||
|
||||
clock.tick();
|
||||
expect(delayedFn2).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("correctly calls functions scheduled while the Clock is advancing", function() {
|
||||
var delayedFn1 = jasmine.createSpy('delayedFn1'),
|
||||
delayedFn2 = jasmine.createSpy('delayedFn2'),
|
||||
delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
delayedFn1.and.callFake(function() { clock.setTimeout(delayedFn2, 1); });
|
||||
clock.install();
|
||||
clock.setTimeout(delayedFn1, 5);
|
||||
|
||||
clock.tick(6);
|
||||
expect(delayedFn1).toHaveBeenCalled();
|
||||
expect(delayedFn2).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("correctly schedules functions scheduled while the Clock is advancing but after the Clock is uninstalled", function() {
|
||||
var delayedFn1 = jasmine.createSpy('delayedFn1'),
|
||||
delayedFn2 = jasmine.createSpy('delayedFn2'),
|
||||
delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
|
||||
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
||||
clock = new jasmineUnderTest.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
delayedFn1.and.callFake(function() {
|
||||
clock.uninstall();
|
||||
clock.install();
|
||||
clock.setTimeout(delayedFn2, 0);
|
||||
});
|
||||
|
||||
clock.install();
|
||||
clock.setTimeout(delayedFn1, 1);
|
||||
|
||||
clock.tick(1);
|
||||
expect(delayedFn1).toHaveBeenCalled();
|
||||
expect(delayedFn2).not.toHaveBeenCalled();
|
||||
|
||||
clock.tick(1);
|
||||
expect(delayedFn2).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not mock the Date object by default", function() {
|
||||
var delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
|
||||
global = {Date: Date},
|
||||
mockDate = new jasmineUnderTest.MockDate(global),
|
||||
clock = new jasmineUnderTest.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
clock.install();
|
||||
|
||||
expect(global.Date).toEqual(Date);
|
||||
|
||||
var now = new global.Date().getTime();
|
||||
|
||||
clock.tick(50);
|
||||
|
||||
expect(new global.Date().getTime() - now).not.toEqual(50);
|
||||
});
|
||||
|
||||
it("mocks the Date object and sets it to current time", function() {
|
||||
var delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
|
||||
global = {Date: Date},
|
||||
mockDate = new jasmineUnderTest.MockDate(global),
|
||||
clock = new jasmineUnderTest.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate);
|
||||
|
||||
clock.install().mockDate();
|
||||
|
||||
var now = new global.Date().getTime();
|
||||
|
||||
clock.tick(50);
|
||||
|
||||
expect(new global.Date().getTime() - now).toEqual(50);
|
||||
|
||||
var timeoutDate = 0;
|
||||
clock.setTimeout(function() {
|
||||
timeoutDate = new global.Date().getTime();
|
||||
}, 100);
|
||||
|
||||
clock.tick(100);
|
||||
|
||||
expect(timeoutDate - now).toEqual(150);
|
||||
});
|
||||
|
||||
it("mocks the Date object and sets it to a given time", function() {
|
||||
var delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
|
||||
global = {Date: Date},
|
||||
mockDate = new jasmineUnderTest.MockDate(global),
|
||||
clock = new jasmineUnderTest.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate),
|
||||
baseTime = new Date(2013, 9, 23);
|
||||
|
||||
|
||||
clock.install().mockDate(baseTime);
|
||||
|
||||
var now = new global.Date().getTime();
|
||||
|
||||
expect(now).toEqual(baseTime.getTime());
|
||||
|
||||
clock.tick(50);
|
||||
|
||||
expect(new global.Date().getTime()).toEqual(baseTime.getTime() + 50);
|
||||
|
||||
var timeoutDate = 0;
|
||||
clock.setTimeout(function() {
|
||||
timeoutDate = new global.Date().getTime();
|
||||
}, 100);
|
||||
|
||||
clock.tick(100);
|
||||
|
||||
expect(timeoutDate).toEqual(baseTime.getTime() + 150);
|
||||
});
|
||||
|
||||
it("mocks the Date object and updates the date per delayed function", function () {
|
||||
var delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
|
||||
global = {Date: Date},
|
||||
mockDate = new jasmineUnderTest.MockDate(global),
|
||||
clock = new jasmineUnderTest.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate),
|
||||
baseTime = new Date();
|
||||
|
||||
clock.install().mockDate(baseTime);
|
||||
|
||||
var actualTimes = [];
|
||||
var pushCurrentTime = function() { actualTimes.push(global.Date().getTime()); };
|
||||
delayedFunctionScheduler.scheduleFunction(pushCurrentTime);
|
||||
delayedFunctionScheduler.scheduleFunction(pushCurrentTime, 1);
|
||||
delayedFunctionScheduler.scheduleFunction(pushCurrentTime, 3);
|
||||
|
||||
clock.tick(1);
|
||||
expect(global.Date().getTime()).toEqual(baseTime.getTime() + 1);
|
||||
|
||||
clock.tick(3);
|
||||
expect(global.Date().getTime()).toEqual(baseTime.getTime() + 4);
|
||||
|
||||
clock.tick(1);
|
||||
expect(global.Date().getTime()).toEqual(baseTime.getTime() + 5);
|
||||
|
||||
expect(actualTimes).toEqual([baseTime.getTime(), baseTime.getTime() + 1, baseTime.getTime() + 3]);
|
||||
})
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user