Comments (8)
@jtesser, @StefH, @kutynko: There is support for angular2 and automatic loading of imported modules from node_modules in the upcoming 2.1 release, if you want to try it out you can pull in the latest from this repo in your package.json:
"karma-typescript": "git://github.com/monounity/karma-typescript.git#2.1"
There are examples for running unit tests with angular2 in the integration tests, please look at the karma.conf.angular2.js and the package.json files.
Integration tests for [email protected]
Integration tests for Typescript@latest
A beta release for 2.1 is expected within the next week or two, you can follow progress and status in the wiki.
Please report any bugs you find as separate issues, that way I can keep track of everything, and give you credit in the release notes.
from karma-typescript.
At first glance it looks like you need to add the angular files to the karma file list, but I suspect you will run into this karma-commonjs issue: karma-runner/karma-commonjs#29. I'll take a look, it's probably easy to reproduce this error.
from karma-typescript.
Thanks for the investigation. Really helpful.
If I get this working, I do not need to use the web solution.
Other question : Did you also get debugging in vscode?
from karma-typescript.
I'm using Atom mostly, do you mean debugging unit tests?
from karma-typescript.
Yes indeed. Debugging unit tests.
If Atom is working for you, I guess VS Code will also be ok.
-----Oorspronkelijk bericht-----
Van: "monounity" [email protected]
Verzonden: 19-9-2016 04:14
Aan: "monounity/karma-typescript" [email protected]
CC: "Stef Heyenrath" "Author" [email protected]
Onderwerp: Re: [monounity/karma-typescript] When using your example settings, Icannot unit test code which uses Angular2 ? (#10)
I'm using Atom mostly, do you mean debugging unit tests?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
from karma-typescript.
As I suspected this was easy to reproduce, I'll try to create a working example!
from karma-typescript.
This is a commojs bridge issue, it wasn't designed to load from node_modules. I'm trying to create a custom module loader at the moment, it's the same issue as in #11.
from karma-typescript.
is there are workaround here? I am using latest karma-typescript and having the same issues?
Can I add something to the files in karma config for node_modules?
getting this which I think is the same error
Uncaught Error: Could not find module '@angular/core' from '/Users/jasontesser/dev/git/dotJS/core/app.config.js'
at node_modules/karma-commonjs/client/commonjs_bridge.js:85
Chrome 53.0.2785 (Mac OS X 10.12.0) ERROR
Uncaught Error: Could not find module '@angular/core' from '/Users/jasontesser/dev/git/dotJS/core/app.config.js'
at node_modules/karma-commonjs/client/commonjs_bridge.js:85
from karma-typescript.
Related Issues (20)
- Failed build under TypeScript 4.5.2 HOT 3
- `lcovonly` does not create `lcov.info`
- karma-typescript attempts to process `node_modules` TS by default config
- request: v5.5.3 release HOT 3
- Acorn parser Ecmaversion doesn't follow Typescript target HOT 2
- The process of Decorator has mistake make the PropertyDescriptor with undefined value
- 'karmaTypescriptConfig' does not exist in type 'ConfigOptions'
- error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. HOT 3
- Coverage report not showing files with zero coverage
- `browser` field of `package.json` not used?
- KarmaTypescript Thresholds not working on TS files rather taking coverage from JS files
- Avoid adding __esModule and default properties for JSON files loaded with require
- error TS18003: No inputs were found in config file 'tsconfig.json'
- Is karma-typescript compatible with Angular 13+ ?
- npm link karma
- Typescript 5 Integration HOT 7
- Add doc deprecation for karma-typescript with recommendations HOT 2
- Exports not define error on latest typescript version
- Error: No source found for .d.ts file
- Can't find sockjs-client/dist/sockjs
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 karma-typescript.