{"action":"created","issue":{"url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/102","repository_url":"https://api.github.com/repos/americanexpress/jest-image-snapshot","labels_url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/102/comments","events_url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/102/events","html_url":"https://github.com/americanexpress/jest-image-snapshot/issues/102","id":359230550,"node_id":"MDU6SXNzdWUzNTkyMzA1NTA=","number":102,"title":"using test.each and jest-image-snapshot/puppeteer","user":{"login":"kevinfoerster","id":163305,"node_id":"MDQ6VXNlcjE2MzMwNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/163305?v=4","gravatar_id":"","url":"https://api.github.com/users/kevinfoerster","html_url":"https://github.com/kevinfoerster","followers_url":"https://api.github.com/users/kevinfoerster/followers","following_url":"https://api.github.com/users/kevinfoerster/following{/other_user}","gists_url":"https://api.github.com/users/kevinfoerster/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinfoerster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinfoerster/subscriptions","organizations_url":"https://api.github.com/users/kevinfoerster/orgs","repos_url":"https://api.github.com/users/kevinfoerster/repos","events_url":"https://api.github.com/users/kevinfoerster/events{/privacy}","received_events_url":"https://api.github.com/users/kevinfoerster/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-11T21:26:46Z","updated_at":"2018-09-14T17:35:58Z","closed_at":"2018-09-14T17:35:58Z","author_association":"NONE","body":"this might be a puppeteer or jest related issue… I try to run `test.each` and `jest-image-snapshot`\r\nI have the following test:\r\n\r\n```javascript\r\nconst { toMatchImageSnapshot } = require(\"jest-image-snapshot\")\r\nexpect.extend({ toMatchImageSnapshot })\r\n\r\nconst puppeteer = require(\"puppeteer\")\r\nconst devices = require(\"puppeteer/DeviceDescriptors\")\r\n\r\n\r\ndescribe(\"running \", () => {\r\n  let browser\r\n\r\n  beforeAll(async () => {\r\n    browser = await puppeteer.launch()\r\n  })\r\n    \r\n  const devicesToTest = [\r\n    \"iPhone 6\",\r\n    \"iPhone 6 Plus landscape\",\r\n    \"iPhone X\",\r\n    \"iPhone X landscape\"\r\n  ]\r\n\r\n  test.each(devicesToTest)(\"visual regression testing: %s\", device => {\r\n    const page = await browser.newPage()\r\n    await page.goto(\"http://localhost:8000\")\r\n    const image = await page.screenshot({ fullPage: true })\r\n    expect(image).toMatchImageSnapshot()\r\n  \r\n  })\r\n\r\n  afterAll(async () => {\r\n    await browser.close()\r\n  })\r\n})\r\n```\r\n\r\nI get an error:\r\n```\r\nconst page = await browser.newPage()\r\n                   ^^^^^^^\r\nSyntaxError: Unexpected identifier\r\n```\r\n\r\n\r\nthe tests run perfectly if I create them one by one, but for obvious reasons I would like create to those test on the fly…\r\n\r\nany idea how this can be fixed?"},"comment":{"url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/comments/421431128","html_url":"https://github.com/americanexpress/jest-image-snapshot/issues/102#issuecomment-421431128","issue_url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/102","id":421431128,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTQzMTEyOA==","user":{"login":"anescobar1991","id":5240221,"node_id":"MDQ6VXNlcjUyNDAyMjE=","avatar_url":"https://avatars2.githubusercontent.com/u/5240221?v=4","gravatar_id":"","url":"https://api.github.com/users/anescobar1991","html_url":"https://github.com/anescobar1991","followers_url":"https://api.github.com/users/anescobar1991/followers","following_url":"https://api.github.com/users/anescobar1991/following{/other_user}","gists_url":"https://api.github.com/users/anescobar1991/gists{/gist_id}","starred_url":"https://api.github.com/users/anescobar1991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anescobar1991/subscriptions","organizations_url":"https://api.github.com/users/anescobar1991/orgs","repos_url":"https://api.github.com/users/anescobar1991/repos","events_url":"https://api.github.com/users/anescobar1991/events{/privacy}","received_events_url":"https://api.github.com/users/anescobar1991/received_events","type":"User","site_admin":false},"created_at":"2018-09-14T17:35:58Z","updated_at":"2018-09-14T17:35:58Z","author_association":"MEMBER","body":"To be honest I have not played with Jest's `.each` feature yet so I am not sure what the issue could be.\r\n\r\nIt looks like this is an issue better raised in the Jest or puppeteer's repo. The error you are showing happens before `toMatchImageSnapshot()` executes."}}
{"actor":{"display_login":"anescobar1991"}}