Skip to content

Commit

Permalink
Code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhwhite committed Jan 26, 2024
1 parent 6fc5732 commit 29bd9f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ describe('Code examples editor service', () => {
it('should add standalone components from code example to app.module.ts', () => {
moduleImports.push('DemoComponent');
service.launchEditor(codeExampleWithStandaloneComponent);
codeExampleWithStandaloneComponent.sourceCode.push({
fileName: 'demo.component.html',
filePath: './',
rawContents: '<p>hello world</p>',
});
service.launchEditor(codeExampleWithStandaloneComponent);

const spyArgs = stackblitzSpy.calls.mostRecent().args;
const appModuleContents = spyArgs[0].files['src/app/app.module.ts'];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SkyDocsSourceCodeProvider } from './source-code-provider';

import { SkyDocsSourceCodeService } from './source-code.service';
import { TestBed } from '@angular/core/testing';

describe('Source code service', () => {
let service: SkyDocsSourceCodeService;
Expand Down Expand Up @@ -76,4 +77,10 @@ describe('Source code service', () => {
});
expect(service.getSourceCodeDependencies('other')).toEqual({});
});

it('should use provider', () => {
const sourceCodeProvider = TestBed.inject(SkyDocsSourceCodeProvider);
expect(sourceCodeProvider).toBeTruthy();
expect(sourceCodeProvider.dependencies).toEqual({});
});
});

0 comments on commit 29bd9f8

Please sign in to comment.