Skip to content

Commit d45c009

Browse files
committed
Reorder some rules for better tests
1 parent d735dd0 commit d45c009

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

test/tests.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
test("run() boolean for match found", function () {
22
expect(1);
33
var router = new PathParser;
4-
router.add('items', function () {
5-
});
4+
router.add('items', function () {});
65
router.add('itemsnomatch', function () {
76
throw "Incorrect match";
87
});
@@ -18,31 +17,34 @@ test("run() boolean for no match found", function () {
1817
test("Single-part fixed path", function () {
1918
expect(1);
2019
var router = new PathParser;
21-
router.add('items', function () {
22-
ok(true);
20+
router.add('items/top', function () {
21+
throw "Incorrect match";
2322
});
2423
router.add('itemsnomatch', function () {
2524
throw "Incorrect match";
2625
});
26+
router.add('item', function () {
27+
throw "Incorrect match";
28+
});
29+
router.add('items', function () {
30+
ok(true);
31+
});
2732
router.run('items');
2833
});
2934

3035
test("Multi-part fixed path", function () {
3136
expect(1);
3237
var router = new PathParser;
33-
router.add('items/top', function () {
34-
throw "Incorrect match";
35-
});
3638
router.add('items', function () {
37-
ok(true);
39+
throw "Incorrect match";
3840
});
3941
router.add('itemsnomatch', function () {
4042
throw "Incorrect match";
4143
});
42-
router.add('item', function () {
43-
throw "Incorrect match";
44+
router.add('items/top', function () {
45+
ok(true);
4446
});
45-
router.run('items');
47+
router.run('items/top');
4648
});
4749

4850
test("Don't match fixed path with additional parts", function () {

0 commit comments

Comments
 (0)