Open rajinder-yadav opened 7 years ago
I confirm. jsdom is missing.
"js-dom": "^0.0.1",
"jsdom": "^9.9.1",
After cleaning node_modules & running npm install again, I have
TypeError: Unable to require `.d.ts` file.
This is usually the result of a faulty configuration or import
Stranger things.
I have added jsdom + travis. Let's keep pushing guys! Thanks a lot!
The tests don't exit and travis can't just figure it out ... Any idea?
@ojacquemart jsdom has a problem on Linux, with respect to contextify, I was getting errors. So I submitted a fix, seem like someone reverted back to require jsdom in mocha.shim.js
?
See Issue: https://github.com/fuse-box/angular2-example/issues/13 and PR: https://github.com/fuse-box/angular2-example/pull/16/files
@rajinder-yadav I am on linux too. No probs with jsdom. If I switch to jsdom-no-contextify in the mocha-shim file, I got the following error:
1) TodoListComponent calls service to get todos:
Error: Error in ./TodoListComponent class TodoListComponent - inline template:16:60 caused by: Cannot read property 'add' of undefined
at ViewWrappedError.Error (native)
at ViewWrappedError.ZoneAwareError (/home/olivier/dev/workspaces/angular2/angular2-example/node_modules/zone.js/dist/zone.js:958:33)
My node version: 6.9.2
In fact, the tests pass on the master. I had a strange directory making it fail previously. I test
@nchanged We should add a specific script and a specifc mocha opts file, for travis.
Without the option --watch src/**/!(main)*.ts
in the mocha.opts
, the tests exit.
@ojacquemart My node and npm are more recent, could be the reason I see errors?
~: $ node -v
v7.4.0
~: $ npm -v
4.2.0
[Update] Confirmed it's versioning issues. If I use the following version, everything works fire.
angular2-example: master$ node -v
v6.9.2
angular2-example: master$ npm -v
3.10.9
Not sure what should be done? either open bug with upstream or find a fix.
I just updated to node 7.5.0 and the everything is workings off master, the test passing!
No idea why it could fail on node 7.4. Great :+1:
I just downloaded the latest version and I'm still having issues
TSError: ⨯ Unable to compile TypeScript
src\todo\todo-list.component.spec.ts (19,1): Cannot find name 'describe'. (2304)
src\todo\todo-list.component.spec.ts (23,5): Cannot find name 'beforeEach'. (2304)
src\todo\todo-list.component.spec.ts (27,5): Cannot find name 'afterEach'. (2304)
src\todo\todo-list.component.spec.ts (31,5): Cannot find name 'beforeEach'. (2304)
src\todo\todo-list.component.spec.ts (51,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (58,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (67,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (73,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (86,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (93,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (107,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (116,5): Cannot find name 'it'. (2304)
On Windows 7
But when I declare the variables, everything is OK :
declare const describe: any;
declare const it: any;
@RPDeshaies maybe you need to place your tsconfig
in the root of your application?
@RPDeshaies Could you try to add "types": [ "node", "mocha", "chai" ]
in the tsconfig.mocha.json?
@ojacquemart not working
@devmondo just tried and I'm still getting the errors
The same problem here:
throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
^
TSError: ⨯ Unable to compile TypeScript
src\todo\todo-list.component.spec.ts (19,1): Cannot find name 'describe'. (2304)
src\todo\todo-list.component.spec.ts (23,5): Cannot find name 'beforeEach'. (2304)
src\todo\todo-list.component.spec.ts (27,5): Cannot find name 'afterEach'. (2304)
src\todo\todo-list.component.spec.ts (31,5): Cannot find name 'beforeEach'. (2304)
src\todo\todo-list.component.spec.ts (51,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (58,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (67,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (73,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (86,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (93,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (107,5): Cannot find name 'it'. (2304)
src\todo\todo-list.component.spec.ts (116,5): Cannot find name 'it'. (2304)
On Linux I am seeing this error:
If I correct
mocha.shim.js
by thisI see a failing test