carbon-tutorial-angular icon indicating copy to clipboard operation
carbon-tutorial-angular copied to clipboard

Step 2: ng test error in repo-table.component.spec.ts

Open warnerjc opened this issue 5 years ago • 3 comments

Had to resolve ng test error after completing Step 2 in the tutorial.

The tutorial steps do not mention adding:

  1. import { TableModule } from 'carbon-components-angular'; to the file head
  2. imports: [ TableModule ] to the TestBed declaration

These steps should be added to Build repo page tutorial steps.

warnerjc avatar Feb 24 '20 19:02 warnerjc

I ran into the same problem, thank you for the hint!

JesseMartinIBM avatar May 20 '20 00:05 JesseMartinIBM

import { GridModule, TableModule } from "carbon-components-angular";

describe("RepoTableComponent", () => {
	let component: RepoTableComponent;
	let fixture: ComponentFixture<RepoTableComponent>;

	beforeEach(async(() => {
		TestBed.configureTestingModule({
			declarations: [RepoTableComponent],
			imports: [GridModule, TableModule],
		}).compileComponents();
	}));

huineng avatar Jun 15 '20 00:06 huineng

Thanks @huineng and @warnerjc

pooshonbanerjee avatar Oct 16 '20 06:10 pooshonbanerjee