Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: generator testing #5012

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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