Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ describe('framework-preset-angular-cli', () => {
const browserTargetOptions = { a: 1, nested: { x: 10 } };
const storybookOptions = { b: 2, nested: { y: 20 } };

vi.mocked(mockBuilderContext.getTargetOptions).mockResolvedValue(browserTargetOptions);
vi.mocked(mockBuilderContext.getTargetOptions)
.mockResolvedValueOnce(browserTargetOptions)
.mockResolvedValueOnce(storybookOptions);

const options: PresetOptions = {
configType: 'DEVELOPMENT',
Expand Down Expand Up @@ -201,7 +203,7 @@ describe('framework-preset-angular-cli', () => {
const result = await getBuilderOptions(options, mockBuilderContext);

expect(mockedTargetFromTargetString).not.toHaveBeenCalled();
expect(mockBuilderContext.getTargetOptions).not.toHaveBeenCalled();
expect(mockBuilderContext.getTargetOptions).toHaveBeenCalledOnce();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi: since we now also use getTargetOptions for retrieving the builder options, it is always called once, and if theres a browserTarget, called twice

expect(result).toEqual({
tsConfig: '/test/tsconfig.json',
});
Expand Down