fixes #55 - Modify tester.findTestFiles to return in predictable order
Showing
2 changed files
with
24 additions
and
22 deletions
... | @@ -394,6 +394,8 @@ var Tester = function(casper, options) { | ... | @@ -394,6 +394,8 @@ var Tester = function(casper, options) { |
394 | }); | 394 | }); |
395 | return entries.filter(function(entry) { | 395 | return entries.filter(function(entry) { |
396 | return utils.isJsFile(fs.absolute(fs.pathJoin(dir, entry))); | 396 | return utils.isJsFile(fs.absolute(fs.pathJoin(dir, entry))); |
397 | }).sort(function(a, b) { | ||
398 | return a > b; | ||
397 | }); | 399 | }); |
398 | }; | 400 | }; |
399 | 401 | ... | ... |
1 | var t = casper.test; | 1 | var t = casper.test; |
2 | 2 | ||
3 | t.comment('Tester.testEquals()'); | 3 | t.comment('Tester.testEquals()'); |
4 | t.assert(casper.test.testEquals(null, null), 'Tester.testEquals() null equality'); | 4 | t.assert(t.testEquals(null, null), 'Tester.testEquals() null equality'); |
5 | t.assertNot(casper.test.testEquals(null, undefined), 'Tester.testEquals() null vs. undefined inequality'); | 5 | t.assertNot(t.testEquals(null, undefined), 'Tester.testEquals() null vs. undefined inequality'); |
6 | t.assert(casper.test.testEquals("hi", "hi"), 'Tester.testEquals() string equality'); | 6 | t.assert(t.testEquals("hi", "hi"), 'Tester.testEquals() string equality'); |
7 | t.assertNot(casper.test.testEquals("hi", "ih"), 'Tester.testEquals() string inequality'); | 7 | t.assertNot(t.testEquals("hi", "ih"), 'Tester.testEquals() string inequality'); |
8 | t.assert(casper.test.testEquals(5, 5), 'Tester.testEquals() number equality'); | 8 | t.assert(t.testEquals(5, 5), 'Tester.testEquals() number equality'); |
9 | t.assertNot(casper.test.testEquals("5", 5), 'Tester.testEquals() number equality without implicit cast'); | 9 | t.assertNot(t.testEquals("5", 5), 'Tester.testEquals() number equality without implicit cast'); |
10 | t.assert(casper.test.testEquals(5, 5.0), 'Tester.testEquals() number equality with cast'); | 10 | t.assert(t.testEquals(5, 5.0), 'Tester.testEquals() number equality with cast'); |
11 | t.assertNot(casper.test.testEquals(5, 10), 'Tester.testEquals() number inequality'); | 11 | t.assertNot(t.testEquals(5, 10), 'Tester.testEquals() number inequality'); |
12 | t.assert(casper.test.testEquals([], []), 'Tester.testEquals() empty array equality'); | 12 | t.assert(t.testEquals([], []), 'Tester.testEquals() empty array equality'); |
13 | t.assert(casper.test.testEquals([1,2], [1,2]), 'Tester.testEquals() array equality'); | 13 | t.assert(t.testEquals([1,2], [1,2]), 'Tester.testEquals() array equality'); |
14 | t.assert(casper.test.testEquals([1,2,[1,2,function(){}]], [1,2,[1,2,function(){}]]), 'Tester.testEquals() complex array equality'); | 14 | t.assert(t.testEquals([1,2,[1,2,function(){}]], [1,2,[1,2,function(){}]]), 'Tester.testEquals() complex array equality'); |
15 | t.assertNot(casper.test.testEquals([1,2,[1,2,function(a){}]], [1,2,[1,2,function(b){}]]), 'Tester.testEquals() complex array inequality'); | 15 | t.assertNot(t.testEquals([1,2,[1,2,function(a){}]], [1,2,[1,2,function(b){}]]), 'Tester.testEquals() complex array inequality'); |
16 | t.assertNot(casper.test.testEquals([1,2], [2,1]), 'Tester.testEquals() shuffled array inequality'); | 16 | t.assertNot(t.testEquals([1,2], [2,1]), 'Tester.testEquals() shuffled array inequality'); |
17 | t.assertNot(casper.test.testEquals([1,2], [1,2,3]), 'Tester.testEquals() array length inequality'); | 17 | t.assertNot(t.testEquals([1,2], [1,2,3]), 'Tester.testEquals() array length inequality'); |
18 | t.assert(casper.test.testEquals({}, {}), 'Tester.testEquals() empty object equality'); | 18 | t.assert(t.testEquals({}, {}), 'Tester.testEquals() empty object equality'); |
19 | t.assert(casper.test.testEquals({a:1,b:2}, {a:1,b:2}), 'Tester.testEquals() object length equality'); | 19 | t.assert(t.testEquals({a:1,b:2}, {a:1,b:2}), 'Tester.testEquals() object length equality'); |
20 | t.assert(casper.test.testEquals({a:1,b:2}, {b:2,a:1}), 'Tester.testEquals() shuffled object keys equality'); | 20 | t.assert(t.testEquals({a:1,b:2}, {b:2,a:1}), 'Tester.testEquals() shuffled object keys equality'); |
21 | t.assertNot(casper.test.testEquals({a:1,b:2}, {a:1,b:3}), 'Tester.testEquals() object inequality'); | 21 | t.assertNot(t.testEquals({a:1,b:2}, {a:1,b:3}), 'Tester.testEquals() object inequality'); |
22 | t.assert(casper.test.testEquals({1:{name:"bob",age:28}, 2:{name:"john",age:26}}, {1:{name:"bob",age:28}, 2:{name:"john",age:26}}), 'Tester.testEquals() complex object equality'); | 22 | t.assert(t.testEquals({1:{name:"bob",age:28}, 2:{name:"john",age:26}}, {1:{name:"bob",age:28}, 2:{name:"john",age:26}}), 'Tester.testEquals() complex object equality'); |
23 | t.assertNot(casper.test.testEquals({1:{name:"bob",age:28}, 2:{name:"john",age:26}}, {1:{name:"bob",age:28}, 2:{name:"john",age:27}}), 'Tester.testEquals() complex object inequality'); | 23 | t.assertNot(t.testEquals({1:{name:"bob",age:28}, 2:{name:"john",age:26}}, {1:{name:"bob",age:28}, 2:{name:"john",age:27}}), 'Tester.testEquals() complex object inequality'); |
24 | t.assert(casper.test.testEquals(function(x){return x;}, function(x){return x;}), 'Tester.testEquals() function equality'); | 24 | t.assert(t.testEquals(function(x){return x;}, function(x){return x;}), 'Tester.testEquals() function equality'); |
25 | t.assertNot(casper.test.testEquals(function(x){return x;}, function(y){return y+2;}), 'Tester.testEquals() function inequality'); | 25 | t.assertNot(t.testEquals(function(x){return x;}, function(y){return y+2;}), 'Tester.testEquals() function inequality'); |
26 | 26 | ||
27 | t.done(); | 27 | t.done(); | ... | ... |
-
Please register or sign in to post a comment