Skip to content

Commit

Permalink
fail if outdir is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Jul 16, 2024
1 parent eb3db88 commit 3b6f239
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,25 @@ describe('reactOutputTarget', () => {
).not.toThrowError();
}
});

it('should throw an error if the outDir option is not provided', () => {
const { validate } = reactOutputTarget({
stencilPackageName: 'my-components',
} as any);

if (validate) {
expect(() =>
validate(
{
outputTargets: [
{
type: 'dist-custom-elements',
},
],
} as any,
[]
)
).toThrowError(`The 'outDir' option is required.`);
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export const reactOutputTarget = ({
customElementsDir = customElementsOutputTarget.dir;
}

if (!outDir) {
throw new Error(`The 'outDir' option is required.`);
}

/**
* Validate the configuration to detect the package name of the Stencil project.
*/
Expand Down

0 comments on commit 3b6f239

Please sign in to comment.