Skip to content

Commit c1b145d

Browse files
committed
WIP: Unskip tests
NO IDEA IF THIS IS THE RIGHT SOLUTION
1 parent ceffca1 commit c1b145d

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

packages/router_js/tests/router_test.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,7 @@ scenarios.forEach(function (scenario) {
17251725
});
17261726
});
17271727

1728-
skip('error route events', function (assert) {
1728+
test('<skip>error route events', function (assert) {
17291729
map(assert, function (match) {
17301730
match('/').to('index');
17311731
match('/posts', function (match) {
@@ -1822,9 +1822,7 @@ scenarios.forEach(function (scenario) {
18221822
}
18231823
};
18241824

1825-
router
1826-
.transitionTo('/')
1827-
.then(() => {
1825+
const transition = router.transitionTo('/').then(() => {
18281826
return router.transitionTo('/posts/1');
18291827
})
18301828
.catch((err: any) => {
@@ -1835,6 +1833,8 @@ scenarios.forEach(function (scenario) {
18351833
assert.equal(enteredWillChange, 4);
18361834
assert.equal(enteredDidChange, 2);
18371835
});
1836+
1837+
assert.rejects(transition);
18381838
});
18391839

18401840
test("when transitioning to a new parent and child state, the parent's context should be available to the child's model", function (assert) {
@@ -3995,7 +3995,7 @@ scenarios.forEach(function (scenario) {
39953995
});
39963996
});
39973997

3998-
skip('aborted transitions can be saved and later retried asynchronously', function (assert) {
3998+
test('<skip>aborted transitions can be saved and later retried asynchronously', function (assert) {
39993999
assert.expect(2);
40004000

40014001
let abortedTransition: Transition;
@@ -4006,7 +4006,10 @@ scenarios.forEach(function (scenario) {
40064006
willTransition: function (transition: Transition) {
40074007
if (shouldPrevent) {
40084008
abortedTransition = transition.abort();
4009-
router.intermediateTransitionTo('loading');
4009+
4010+
const t = router.intermediateTransitionTo('loading');
4011+
4012+
assert.rejects(t, `router.intermediateTransitionTo('loading') fails`);
40104013
}
40114014
},
40124015
},
@@ -6418,7 +6421,7 @@ scenarios.forEach(function (scenario) {
64186421
assert.equal(projectSetupCount, 2, 'project handler should have been setup twice');
64196422
});
64206423

6421-
skip('synchronous transition errors can be detected synchronously', function (assert) {
6424+
test('<skip>synchronous transition errors can be detected synchronously', function (assert) {
64226425
map(assert, function (match) {
64236426
match('/').to('root');
64246427
});
@@ -6427,6 +6430,9 @@ scenarios.forEach(function (scenario) {
64276430
throw new Error('boom!');
64286431
};
64296432

6430-
assert.equal((transitionTo(router, '/').error as Error).message, 'boom!');
6433+
const transition = transitionTo(router, '/');
6434+
6435+
assert.rejects(transition);
6436+
assert.equal((transition.error as Error).message, 'boom!');
64316437
});
64326438
});

0 commit comments

Comments
 (0)