{"action":"created","issue":{"url":"https://api.github.com/repos/jamesshore/test-console/issues/7","repository_url":"https://api.github.com/repos/jamesshore/test-console","labels_url":"https://api.github.com/repos/jamesshore/test-console/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/jamesshore/test-console/issues/7/comments","events_url":"https://api.github.com/repos/jamesshore/test-console/issues/7/events","html_url":"https://github.com/jamesshore/test-console/issues/7","id":350058141,"node_id":"MDU6SXNzdWUzNTAwNTgxNDE=","number":7,"title":"Jest based testing log inclusion","user":{"login":"Berkmann18","id":8260834,"node_id":"MDQ6VXNlcjgyNjA4MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/8260834?v=4","gravatar_id":"","url":"https://api.github.com/users/Berkmann18","html_url":"https://github.com/Berkmann18","followers_url":"https://api.github.com/users/Berkmann18/followers","following_url":"https://api.github.com/users/Berkmann18/following{/other_user}","gists_url":"https://api.github.com/users/Berkmann18/gists{/gist_id}","starred_url":"https://api.github.com/users/Berkmann18/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Berkmann18/subscriptions","organizations_url":"https://api.github.com/users/Berkmann18/orgs","repos_url":"https://api.github.com/users/Berkmann18/repos","events_url":"https://api.github.com/users/Berkmann18/events{/privacy}","received_events_url":"https://api.github.com/users/Berkmann18/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-13T14:38:15Z","updated_at":"2018-08-14T08:36:46Z","closed_at":"2018-08-14T08:36:46Z","author_association":"NONE","body":"I just saw this package and integrated it to my Jest tests but oddly it seems to not give the same output as with the example on the README.\r\n\r\nHere's the minimal test code:\r\n```js\r\nconst stdout = require('test-console').stdout;\r\n\r\ntest('info', () => {\r\n  const output = stdout.inspectSync(() => console.log('foo'));\r\n  expect(outpu).toStrictEqual(['foo\\n']);\r\n})\r\n```\r\nThe result is the following:\r\n```bash\r\nExpected value to equal:\r\n      [\"foo\r\n    \"]\r\n    Received:\r\n\", \"  console.log test/utils.test.js:7\r\n        foo\r\n    \r\n    \"]\r\n\r\n    Difference:\r\n\r\n    - Expected\r\n    + Received\r\n\r\n      Array [\r\n    -   \"foo\r\n\",\r\n    +   \"  console.log test/utils.test.js:7\r\n    +     foo\r\n    + \r\n      \",\r\n      ]\r\n```\r\n\r\nSo essentially it seems to not filter out something out.\r\n\r\nI found that it was returning this:\r\n```bash\r\n [ '\\u001b[999D\\u001b[K',\r\n      '  \\u001b[2mconsole.log\\u001b[22m \\u001b[2mtest/utils.test.js:7\\u001b[22m\\n    foo\\n\\n' ]\r\n```\r\nSo it's not CLI colour agnostic and not targetted to what was printed via `inspectSync`.\r\nIs this normal?"},"comment":{"url":"https://api.github.com/repos/jamesshore/test-console/issues/comments/412797453","html_url":"https://github.com/jamesshore/test-console/issues/7#issuecomment-412797453","issue_url":"https://api.github.com/repos/jamesshore/test-console/issues/7","id":412797453,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjc5NzQ1Mw==","user":{"login":"jamesshore","id":123129,"node_id":"MDQ6VXNlcjEyMzEyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/123129?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesshore","html_url":"https://github.com/jamesshore","followers_url":"https://api.github.com/users/jamesshore/followers","following_url":"https://api.github.com/users/jamesshore/following{/other_user}","gists_url":"https://api.github.com/users/jamesshore/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesshore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesshore/subscriptions","organizations_url":"https://api.github.com/users/jamesshore/orgs","repos_url":"https://api.github.com/users/jamesshore/repos","events_url":"https://api.github.com/users/jamesshore/events{/privacy}","received_events_url":"https://api.github.com/users/jamesshore/received_events","type":"User","site_admin":false},"created_at":"2018-08-14T08:36:46Z","updated_at":"2018-08-14T08:36:46Z","author_association":"OWNER","body":"Glad to hear it. Looks like the issue is that Jest modifies console.log."}}
{"actor":{"display_login":"jamesshore"}}