Uh oh!
There was an error while loading. Please reload this page.
chore: update specs to TestBed - #184
Conversation
Foxandxss
commented
Aug 17, 2016
Fixed, @filipesilva review please. |
35c8f2c to
e9fea60Compare| }) | ||
| .then(__karma__.start, __karma__.error); | ||
| System.import('@angular/core/testing') | ||
| .then(function (coreTesting) { |
There was a problem hiding this comment.
Can you separate these into a similar setup as before? It's usually nicer to see:
System.import('systemjs.config.js')
.then(() => Promise.all([
System.import('@angular/core/testing'),
System.import('@angular/platform-browser-dynamic/testing')
]))
.then((providers) => {
var coreTesting = providers[0];
var browserTesting = providers[1];
coreTesting.TestBed.initTestEnvironment(
browserTesting.BrowserDynamicTestingModule, browserTesting.platformBrowserDynamicTesting());
})
.then(function () {
// Finally, load all spec files.
// This will run the tests directly.
return Promise.all(
allSpecFiles.map(function (moduleName) {
return System.import(moduleName);
}));
})
.then(__karma__.start, __karma__.error);
filipesilva
commented
Aug 17, 2016
Have that nit, otherswise LGTM. |
Foxandxss
commented
Aug 17, 2016
Changed that. |
psnider
commented
Aug 19, 2016
I was about to report an issue that the karma tests don't work, but then I saw your changes here, and I integrated them into my workspace. However, I'm still getting failures when I run npm test from part 1 of Tour of Heroes tutorial, The Hero Editor. I created a new repo for QuickStart: And npm test runs correctly. However, once I add the files from part 1 of the Tour-of-Heroes, the tests fail. |
Found a solution! To app.component.ts, I added at the top: and within Can you please update the part 1 page of the tutorial? |
filipesilva
commented
Aug 19, 2016
@psnider I would avoid that solution, because afaik it will not work in the near future. Instead, what you should do is configure the testing module to import the |
I couldn't get this to work. I modified app.component.spec.ts: and What am I missing? and here's the first part of the new error: |
filipesilva
commented
Aug 19, 2016
Well the testing module is like a normal module, right? So let's look at the toh-1 Basically, Not too sure why the |
psnider
commented
Aug 19, 2016
Thanks so much, I'm paying close attention to testing, and want to make sure that all of the tests run at the end of each part of the tutorial. FWIW, the testing support you have with the QuickStart and tutorial is very valuable to me. |
What bits of it make it a struggle, specifically? |
psnider
commented
Aug 19, 2016
The bits that make it a struggle
DetailsTrying to configure karma and systemjs has been very difficult. karma The karma configuration seems to be much more complex than what is described in http://karma-runner.github.io/1.0/config/configuration-file.html and http://karma-runner.github.io/1.0/config/files.html. systemjs karma and system.js together with angular Another point of confusion is that the same symbol names are used for many things. changing the project directory structure |
filipesilva
commented
Oct 6, 2016
Heya @psnider, we have a revised and very complete Testing guide at https://angular.io/docs/ts/latest/guide/testing.html#!#setup-files. It doesn't answer all of difficulties, but I think it answers most of them. |
wardbell
commented
Oct 6, 2016
@psnider I wince as I read your perfectly reasonable questions. Our testing guide does not yet cover re-configuration of karma and systemjs for a different project structure. It's on our backlog. Your questions here are helpful and will inform our effort to take this necessary next step. What should you do for now? Ah ... I'll be back ;-) |
psnider
commented
Oct 16, 2016
@filipesilva@wardbell Now I'm only missing one thing:
I'd greatly appreciate you keeping me up to date with any improvements to the karma documentation! Please feel free to comment directly on my project, if you like. |
NOT to merge until angular/zone.js#404 is fixed.