garris / ember-backstop

BackstopJS visual regression testing addon for Ember.
MIT License
56 stars 21 forks source link

Undefined error when running without options #84

Closed gvdp closed 1 year ago

gvdp commented 1 year ago

I'm using a simple await backstop(assert); to test, and since one of the last version it's throwing an error

Source:     
TypeError: Cannot read properties of undefined (reading 'testId')
    at createNameHash (http://localhost:4200/assets/test-support.js:7321:33)
    at _default (http://localhost:4200/assets/test-support.js:7362:18)
    at Object.<anonymous> (http://localhost:4200/assets/tests.js:27:37)

I think it stems from this PR: https://github.com/garris/ember-backstop/pull/83

Because in my case I didn't pass anything options is undefined in the new line testHash.testId = options.testId ?? window._testRunTime;

Passing an empty object as option fixes the error but I'll prepare a PR to prevent this in future.