-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Testing: misleading error message when don't call compileComponents #11301
Copy link
Copy link
Closed
Labels
area: testingIssues related to Angular testing features, such as TestBedIssues related to Angular testing features, such as TestBedhotlist: error messages
Description
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request
Current behavior
Component doesn't have a templateUrl but DOES have styleUrls.
@Component({
selector: 'dashboard-hero',
template: '<div class="hero" (click)="click()">{{hero.name | uppercase}}</div>',
styleUrls: ['app/dashboard/dashboard-hero.component.css']
})
When don't call TestBed.compileComponents the error message is
Error: This test module uses the component DashboardHeroComponent which is using a "templateUrl", but they were never compiled. Please call "TestBed.compileComponents" before your test.
This is ALMOST correct. The problem is that it is the styleUrls that cause the problem, not the (non-existent) templateUrl
Expected/desired behavior
Could say
which is using a "templateUrl" or "stylerUrls"
Please tell us about your environment:
- Angular version: 2.0.0-rc.6
- Browser: [all ]
- Language: [all]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: testingIssues related to Angular testing features, such as TestBedIssues related to Angular testing features, such as TestBedhotlist: error messages