Meteor-Community-Packages / meteor-mocha

A Mocha test driver package for Meteor 1.3+. This package reports server AND client test results in the server console and can be used for running tests on a CI server or locally.
https://packosphere.com/meteortesting/mocha
MIT License
67 stars 40 forks source link

Puppeteer app-test yields "TypeError: Cannot read property 'call' of undefined" #101

Open jonlachlan opened 4 years ago

jonlachlan commented 4 years ago

I'm having trouble getting Puppeteer to work and I can't track down where it's coming from. I made a repro at https://github.com/jonlachlan/meteor-mocha-puppeteer-app-test-error-repro using meteor create --minimal and I changed the test-app script to include TEST_BROWSER_DRIVER=puppeteer.

I made a simple test at /client/main.app-test.js that loads the page:

const puppeteer = require('puppeteer');

describe('main', () => {
    it('loads without errors', async function () {
        const browser = await puppeteer.launch();
        const page = await browser.newPage();
        await page.goto('http://localhost:3000');
        await browser.close();
    })
})

When I run yarn test-app I get "TypeError: Cannot read property 'call' of undefined".