{"action":"created","issue":{"url":"https://api.github.com/repos/wallabyjs/public/issues/1597","repository_url":"https://api.github.com/repos/wallabyjs/public","labels_url":"https://api.github.com/repos/wallabyjs/public/issues/1597/labels{/name}","comments_url":"https://api.github.com/repos/wallabyjs/public/issues/1597/comments","events_url":"https://api.github.com/repos/wallabyjs/public/issues/1597/events","html_url":"https://github.com/wallabyjs/public/issues/1597","id":310297264,"number":1597,"title":"Wallaby not working with jasmine callFake","user":{"login":"joilson-cisne","id":6042150,"avatar_url":"https://avatars2.githubusercontent.com/u/6042150?v=4","gravatar_id":"","url":"https://api.github.com/users/joilson-cisne","html_url":"https://github.com/joilson-cisne","followers_url":"https://api.github.com/users/joilson-cisne/followers","following_url":"https://api.github.com/users/joilson-cisne/following{/other_user}","gists_url":"https://api.github.com/users/joilson-cisne/gists{/gist_id}","starred_url":"https://api.github.com/users/joilson-cisne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joilson-cisne/subscriptions","organizations_url":"https://api.github.com/users/joilson-cisne/orgs","repos_url":"https://api.github.com/users/joilson-cisne/repos","events_url":"https://api.github.com/users/joilson-cisne/events{/privacy}","received_events_url":"https://api.github.com/users/joilson-cisne/received_events","type":"User","site_admin":false},"labels":[{"id":150744620,"url":"https://api.github.com/repos/wallabyjs/public/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-01T05:36:47Z","updated_at":"2018-04-01T06:46:05Z","closed_at":"2018-04-01T06:46:05Z","author_association":"NONE","body":"### Issue description or question\r\nWallaby seems not to be working with jasmine `callFake`. The argument of the \"fake\" function is always `undefined`.\r\n\r\nThe test below passes when I run with jasmine directly, but it breaks when running with wallaby. Does anyone had this problem before?\r\n\r\n```js\r\nit('test callFake and wallaby', async () => {\r\n      // Arrange\r\n      const myObj = {\r\n        myFunc: (a) => a + 1,\r\n      };\r\n\r\n      spyOn(myObj, 'myFunc')\r\n        .and.callFake(arg => arg);\r\n      \r\n      // Act\r\n      const result = myObj.myFunc(1);\r\n\r\n      // Assert\r\n      expect(result).toBe(1);\r\n    });\r\n```\r\n\r\n### Wallaby.js configuration file\r\n\r\n```javascript\r\nmodule.exports = (wallaby) => {\r\n  return {\r\n    files: [\r\n      'src/**/*.js',\r\n      'migrations/*',\r\n      'test/_helpers/*',\r\n      'seeds/*',\r\n      'config/*',\r\n      { pattern: '.env', instrument: false },\r\n    ],\r\n\r\n    tests: [\r\n      'test/**/*.spec.js',\r\n    ],\r\n\r\n    compilers: {\r\n      '**/*.js': wallaby.compilers.babel(),\r\n    },\r\n\r\n    testFramework: 'jasmine',\r\n\r\n    env: {\r\n      type: 'node',\r\n\r\n      params: {\r\n        env: 'NODE_ENV=test;MONGODB_CONQUERY=mongodb://localhost:27017/athena-test',\r\n      },\r\n    },\r\n    workers: {\r\n      initial: 1,\r\n      regular: 1,\r\n      restart: true,\r\n    },\r\n\r\n    setup: (/* wallaby */) => {\r\n      require('dotenv').load({ path: '.env' }); // eslint-disable-line\r\n      require('./test/_helpers/dropDatabase'); // eslint-disable-line\r\n    },\r\n\r\n    teardown: (/* wallaby */) => {\r\n    },\r\n  };\r\n};\r\n\r\n```\r\n\r\n### Code editor or IDE name and version\r\n\r\nVisual Studio Code v1.21.1\r\n\r\n### OS name and version\r\n\r\nOSX 10.13.3\r\n"},"comment":{"url":"https://api.github.com/repos/wallabyjs/public/issues/comments/377766741","html_url":"https://github.com/wallabyjs/public/issues/1597#issuecomment-377766741","issue_url":"https://api.github.com/repos/wallabyjs/public/issues/1597","id":377766741,"user":{"login":"ArtemGovorov","id":979966,"avatar_url":"https://avatars1.githubusercontent.com/u/979966?v=4","gravatar_id":"","url":"https://api.github.com/users/ArtemGovorov","html_url":"https://github.com/ArtemGovorov","followers_url":"https://api.github.com/users/ArtemGovorov/followers","following_url":"https://api.github.com/users/ArtemGovorov/following{/other_user}","gists_url":"https://api.github.com/users/ArtemGovorov/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtemGovorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtemGovorov/subscriptions","organizations_url":"https://api.github.com/users/ArtemGovorov/orgs","repos_url":"https://api.github.com/users/ArtemGovorov/repos","events_url":"https://api.github.com/users/ArtemGovorov/events{/privacy}","received_events_url":"https://api.github.com/users/ArtemGovorov/received_events","type":"User","site_admin":false},"created_at":"2018-04-01T06:46:05Z","updated_at":"2018-04-01T06:46:05Z","author_association":"OWNER","body":"Thanks for the report. Apparently you are using Jasmine 2.9, because your code is working as expected in Jasmine 3.x. The bug in Jasmine 2.x support was introduced recently when adding Jasmine 3 support in wallaby. \r\n\r\nThe regression is fixed and the fix had juts been published in [the latest core](https://wallabyjs.com/docs/intro/troubleshooting.html#forcing-wallabyjs-core-update) (or update your Jasmine version to 3.x)."}}
{"actor":{"display_login":"ArtemGovorov"}}