-
Notifications
You must be signed in to change notification settings - Fork 466
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
Regression: "ReferenceError: global is not defined" #756
Comments
Could you include a minimal repro? There are no references to Though the references in the bundled |
@eps1lon Of course, here: https://github.com/EvgenyOrekhov/ember-with-testing-library. It is a freshly-generated Ember app with a single test file: https://github.com/EvgenyOrekhov/ember-with-testing-library/blob/master/tests/integration/components/my-component-test.js. Importing Steps to reproduce: git clone git@github.com:EvgenyOrekhov/ember-with-testing-library.git
cd ember-with-testing-library
npm install
npm run test:watch A new Chrome window will open up and throw an error. Important observation: when I run the tests in CLI mode (using |
It definitely should work with an actual browser (many people are testing with actual browsers). Something else is going on where this is somehow running in an environment that has neither a So investigation needs to be made to determine why |
I'm not sure what to tell you 🤷♂️ |
@eps1lon This is the first file from the stack trace that references |
Thanks. I see the issue and think I know how to solve it. I just want to get the fix right so that we don't regress in the future.
|
I personally don't have the bandwidth to fix this. Codesandbox, rollup as well as karma do transpile |
@eps1lon Ember uses webpack and Babel under the hood, so it should be able to transpile |
@Bulletninja This is still the latest status:
|
this is happening for us in jest27 is there a workaround? |
@sibelius If you're using webpack, I believe you can enable module.exports = {
//...
node: {
global: true
}
}; Reference: https://v4.webpack.js.org/configuration/node/. |
this is a problem only when running tests with jest 27 |
this is happening for us in jest27 |
Adding this dev dep solves the error for me (jest 27) |
In the Jest 27 release notes, they note the shift from defaulting to |
This solved the problem for me. Big thanks, I worked on this for couple of days, nothing else worked. |
Closed by #966 |
- testing-library/dom-testing-library#756 - 위와 같은 이슈가 생기고 있어 문제 해결
- testing-library/dom-testing-library#756 - 위와 같은 이슈가 생기고 있어 문제 해결
Sorry to comment on closed issue, but I still have the same problem. I'm using This is import vite from 'vite-web-test-runner-plugin';
export default {
nodeResolve: true,
esbuildTarget: 'auto',
files: 'src/**/__tests__/**/*.test.js',
plugins: [
vite()
]
}; This is the stack trace:
|
This issue is fixed in |
@testing-library/dom
version: 7.22.6Relevant code or config:
What you did:
I ran my tests:
ember test --server
.What happened:
Tests couldn't be executed, the following error was thrown:
Reproduction:
Problem description:
@testing-library/dom
7.22.3 was working fine.@testing-library/dom
7.22.6 doesn't work.Suggested solution:
I can see there was a bump of pretty-format between 7.22.3 and 7.22.6: 9cbc428, perhaps it's the culprit.
The text was updated successfully, but these errors were encountered: