Skip to content

Commit

Permalink
fix: generator testing
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrieLii committed Nov 29, 2023
1 parent f4eadb5 commit 460e45c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/generator/new-action/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const ModuleNewAction = async (options: IModuleNewActionOption) => {
});

if (!hasOption) {
smith.logger.warn('no option can be enabled');
smith.logger.warn('No option can be enabled, exit 1.', funcMap);
// eslint-disable-next-line no-process-exit
process.exit(1);
}
Expand Down
3 changes: 3 additions & 0 deletions tests/generator/utils/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ async function addNewActionDevDependence(repoCwd: string) {
'packages/generator/new-action/package.json',
);
const pkgJSON = JSON.parse(await fs.readFile(actionPath, 'utf-8'));

// Should add new generator below for testing
pkgJSON.devDependencies = {
...pkgJSON.devDependencies,
'@modern-js/bff-generator': 'workspace:*',
Expand All @@ -23,6 +25,7 @@ async function addNewActionDevDependence(repoCwd: string) {
'@modern-js/ssg-generator': 'workspace:*',
'@modern-js/module-test-generator': 'workspace:*',
'@modern-js/rspack-generator': 'workspace:*',
'@modern-js/module-doc-generator': 'workspace:*',
};
await fs.writeFile(
actionPath,
Expand Down

0 comments on commit 460e45c

Please sign in to comment.