Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ReferenceError: mocha is not defined #52

Closed
Gozala opened this issue Aug 6, 2020 · 4 comments · Fixed by #83
Closed

Error: ReferenceError: mocha is not defined #52

Gozala opened this issue Aug 6, 2020 · 4 comments · Fixed by #83

Comments

@Gozala
Copy link
Contributor

Gozala commented Aug 6, 2020

As I was working on achingbrain/it#8 I started seeing following errors coming from playwright-test

npm test
> browser-readablestream-to-it@0.0.1 test /Users/gozala/Projects/it/packages/browser-readablestream-to-it
> playwright-test

✔ Browser setup
✔ Bundling tests
'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead.
file:////Users/gozala/Projects/it/node_modules/mocha/mocha.js:25915

 Error: ReferenceError: mocha is not defined
    at eval (file:////Users/gozala/Projects/it/node_modules/playwright-test/src/setup-mocha.js:9:1)
    at Object.../../node_modules/playwright-test/src/setup-mocha.js (http://localhost:3000/bundle.509459cbd52e64d9231b.js:519:1)
    at __webpack_require__ (http://localhost:3000/bundle.509459cbd52e64d9231b.js:20:30)
    at eval (file:///multi%2520/Users/gozala/Projects/it/node_modules/playwright-test/src/setup-mocha.js%2520/Users/gozala/Projects/it/packages/browser-readablestream-to-it/test.js:1:1)
    at Object.0 (http://localhost:3000/bundle.509459cbd52e64d9231b.js:588:1)
    at __webpack_require__ (http://localhost:3000/bundle.509459cbd52e64d9231b.js:20:30)
    at http://localhost:3000/bundle.509459cbd52e64d9231b.js:84:18
    at http://localhost:3000/bundle.509459cbd52e64d9231b.js:87:10
npm ERR! Test failed.  See above for more details.

To check if there was something wrong with my changes or setup I submitted pull with muster and empty commit here
achingbrain/it#10

Which seems to still fail https://travis-ci.org/github/achingbrain/it/jobs/715667645

Not sure what is causing this yet.

@Gozala
Copy link
Contributor Author

Gozala commented Aug 6, 2020

Master that was publish 13 days ago seems to have passed all these test achingbrain/it@1b928cb

@Gozala
Copy link
Contributor Author

Gozala commented Aug 6, 2020

I'm guessing some of the minor deps got published causing this.

@Gozala
Copy link
Contributor Author

Gozala commented Aug 6, 2020

npm ls mocha --dev            
browser-readablestream-to-it@0.0.1 /Users/gozala/Projects/it/packages/browser-readablestream-to-it
└── UNMET DEPENDENCY mocha@^8.0.1

npm ERR! missing: mocha@^8.0.1, required by browser-readablestream-to-it@0.0.1

Not sure why, but I'm starting to think this might be problem with it instead.

@Gozala
Copy link
Contributor Author

Gozala commented Aug 6, 2020

Ok looks like issue has to do with the fact that despite "mocha": "^8.0.1" in package.json version installed ends up been mocha@8.1.1 which seems to cause trouble. Setting version to strict "mocha": "8.0.1" seems to resolve the problem. However that also suggest that playwright-test is incompatible with mocha@8.1.1.

Gozala added a commit to Gozala/it that referenced this issue Aug 7, 2020
Gozala added a commit to Gozala/it that referenced this issue Aug 7, 2020
achingbrain pushed a commit to achingbrain/it that referenced this issue Aug 14, 2020
Gozala added a commit to Gozala/web-encoding that referenced this issue Aug 19, 2020
Gozala added a commit to Gozala/web-encoding that referenced this issue Aug 19, 2020
Gozala added a commit to Gozala/web-encoding that referenced this issue Aug 19, 2020
hugomrdias added a commit that referenced this issue Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant