{"action":"created","issue":{"url":"https://api.github.com/repos/jasmine/jasmine/issues/782","labels_url":"https://api.github.com/repos/jasmine/jasmine/issues/782/labels{/name}","comments_url":"https://api.github.com/repos/jasmine/jasmine/issues/782/comments","events_url":"https://api.github.com/repos/jasmine/jasmine/issues/782/events","html_url":"https://github.com/jasmine/jasmine/issues/782","id":58074484,"number":782,"title":"jasmine.clock().install() doesn't throw errors when called multiple times","user":{"login":"mik01aj","id":3027415,"avatar_url":"https://avatars.githubusercontent.com/u/3027415?v=3","gravatar_id":"","url":"https://api.github.com/users/mik01aj","html_url":"https://github.com/mik01aj","followers_url":"https://api.github.com/users/mik01aj/followers","following_url":"https://api.github.com/users/mik01aj/following{/other_user}","gists_url":"https://api.github.com/users/mik01aj/gists{/gist_id}","starred_url":"https://api.github.com/users/mik01aj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mik01aj/subscriptions","organizations_url":"https://api.github.com/users/mik01aj/orgs","repos_url":"https://api.github.com/users/mik01aj/repos","events_url":"https://api.github.com/users/mik01aj/events{/privacy}","received_events_url":"https://api.github.com/users/mik01aj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-18T14:31:53Z","updated_at":"2015-02-18T16:20:23Z","closed_at":null,"body":"I believe it should, because when I have 2 tests like this:\r\n\r\n```\r\nit('a', function (done) {\r\n    jasmine.clock.install(); \r\n    // ... some async code, calling done() when it's finished ...\r\n    jasmine.clock.tick(100); // this runs the async code\r\n    jasmine.clock.uninstall(); // and this doesn't get called (this is a bug in my test)\r\n}\r\n\r\nit('b', function () {\r\n    jasmine.clock.install(); \r\n    // ... init theThing - it will be ready in 2 ticks ...\r\n    jasmine.clock.tick(1);\r\n    expect(theThing.isReady).toBe(false); // normally this would be ok, nut now will fail because of unnecessary ticks (because of bug in the test a)\r\n    jasmine.clock.tick(1);\r\n    expect(theThing.isReady).toBe(true);\r\n    jasmine.clock.uninstall();\r\n}\r\n```\r\n\r\nWhat happens here? The test `a` succeeds and `b` fails. But `b` fails only because `a` didn't clean up after itself! This introduces subtle dependencies between tests and makes tests using Jasmine clock a nightmare to debug in big projects.\r\n\r\nI know that I should call `jasmine.clock.install()` from `beforeEach`, and so on, i.e. I know this isn't a good test. But I would expect the testing framework to do some sanity checks like these for me. And I would expect the test framework to do its best to make each test case independent of each other.\r\n\r\nI'm using jasmine `2.2.0`."},"comment":{"url":"https://api.github.com/repos/jasmine/jasmine/issues/comments/74893529","html_url":"https://github.com/jasmine/jasmine/issues/782#issuecomment-74893529","issue_url":"https://api.github.com/repos/jasmine/jasmine/issues/782","id":74893529,"user":{"login":"infews","id":12400,"avatar_url":"https://avatars.githubusercontent.com/u/12400?v=3","gravatar_id":"","url":"https://api.github.com/users/infews","html_url":"https://github.com/infews","followers_url":"https://api.github.com/users/infews/followers","following_url":"https://api.github.com/users/infews/following{/other_user}","gists_url":"https://api.github.com/users/infews/gists{/gist_id}","starred_url":"https://api.github.com/users/infews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infews/subscriptions","organizations_url":"https://api.github.com/users/infews/orgs","repos_url":"https://api.github.com/users/infews/repos","events_url":"https://api.github.com/users/infews/events{/privacy}","received_events_url":"https://api.github.com/users/infews/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T16:20:23Z","updated_at":"2015-02-18T16:20:23Z","body":"Your example isn't clear. Can you provide a full suite (`describe`, etc.) that shows the problem?"}}