Comments (13)
As mentioned above, this has to do with other addons (in our case brocolli-browserify
) overwriting window.require
. I don't think it's actually anything this project wants to do anything about. @rox163 You can probably close this guy.
from ember-cli-code-coverage.
Can you tell me if Object.keys(require.entries)
causes the same error?
If it does, this is likely the same (or related to the same root cause) as #66.
from ember-cli-code-coverage.
@rwjblue Not sure. What would you like me to do to test that Object.keys
line?
from ember-cli-code-coverage.
Run ember test --server
, after your tests run in your browser open the console, type Object.keys(require.entries)
. Is there an error?
from ember-cli-code-coverage.
@rwjblue Yes there is an error.
from ember-cli-code-coverage.
Any suggestions on how to debug/work around this? As far as I can tell there is no custom require
in my project directly but not sure about the dependent addons. We dont use yadda as was mentioned as the culprit in the other issue.
I can point you to a project that has this failure when the coverage version is set to 0.3.6 - https://github.com/ciena-frost/ember-frost-popover/blob/master/package.json
from ember-cli-code-coverage.
Related to #66 as in my case it seems to be a conflict with mocha's require.
from ember-cli-code-coverage.
Bump. I've been running into the same issue:
not ok 219 Chrome 54.0 - Global error: Uncaught TypeError: Cannot convert undefined or null to object at http://localhost:7357/assets/vendor.js, line 73209
---
Log: |
{ type: 'error',
text: 'Uncaught TypeError: Cannot convert undefined or null to object at http://localhost:7357/assets/vendor.js, line 73209\n' }
...
not ok 220 Chrome 54.0 - JSHint | unit/mixins/table-header-test.js: global failure
---
actual: >
null
stack: >
http://localhost:7357/assets/vendor.js:73209
message: >
Uncaught TypeError: Cannot convert undefined or null to object
Log: |
...
Running on ember-light-table w/ [email protected]
from ember-cli-code-coverage.
@offirgolan are you using something that redefines the global require
?
from ember-cli-code-coverage.
When running what @rwjblue suggested
Run ember test --server, after your tests run in your browser open the console, type Object.keys(require.entries). Is there an error?
I get the same error. require.entries
is undefined. I do not believe I have any package that would redefine the global require either...
from ember-cli-code-coverage.
I have made a PR to unblock those who are facing this issue. It's a simple require.entries || {}
fix.
This doesn't fix any underlying issues with conflicting versions of require but it unblocks those who have conflicting versions.
from ember-cli-code-coverage.
In case anyone else is still having an issue with an overwritten require
and would like help tracking it down: I added the following to my tests/index.html
(got the console.watch
bit from here: http://stackoverflow.com/a/11658693)
<script>
console = console || {}; // just in case
console.watch = function(oObj, sProp) {
sPrivateProp = "$_"+sProp+"_$"; // to minimize the name clash risk
oObj[sPrivateProp] = oObj[sProp];
// overwrite with accessor
Object.defineProperty(oObj, sProp, {
get: function () {
return oObj[sPrivateProp];
},
set: function (value) {
//console.log("setting " + sProp + " to " + value);
debugger; // sets breakpoint
oObj[sPrivateProp] = value;
}
});
}
console.watch(window, 'require')
</script>
And then ran my tests in the browser (I used ember s -e test
but you could use ember test --server
as well). The second debugger
that was hit was my culprit.
Still tracking down exactly where the file browserfied-highlight.js
comes from, but in our case, it looks like that's the one causing problems.
EDIT: I tracked it down, looks like ember-code-snippet
is the addon adding a module that's overriding require
.
from ember-cli-code-coverage.
I opened ef4/ember-code-snippet#34 to bring it to the attention of the authors of ember-code-snippet
. In the meantime, I think I'll use a fork of that project that doesn't use broccoli-browserify
from ember-cli-code-coverage.
Related Issues (20)
- TS files are not included in the coverage with `--path` option HOT 2
- Dramatic build slowdown when enabled HOT 3
- Question - Is there a way to fail the test run if the coverage is below a certain threshold?
- Request aborted - BadRequestError seen from v2.0.0-beta.2 HOT 6
- write-coverage errors out with 403
- Seems to break when using the ember-concurrency new api HOT 5
- Unexpected token { error
- [QUERY] Is it possible to generate the coverage for a specific file/spec module (integration) HOT 2
- Issue with migration to v2.0.0
- No coverage report generated when used with @embroider/compat@^2.1.0 HOT 10
- Exclude app files from ember engine? tried with many glob patterns nothing is working..
- Socket timeouts POSTing to /write-coverage when running tests in CI mode HOT 3
- Not respecting "inputSourceMap" field from reported coverage data (fails for .gjs - ember-template-imports) HOT 2
- New release? HOT 10
- Coverage not collected in Embroider >3.1 HOT 6
- Is it possible to get coverage of hbs files with qunits and this coverage tool? HOT 1
- Issues with first-class component templates? HOT 12
- Embroider Tests are verifying that we have no coverage data HOT 1
- Version 2.0.1 not published HOT 1
- Coverage fails in dev mode (ember serve) on 2.0.3 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cli-code-coverage.