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

feat(ut): Add test #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ivanchenhz
Copy link
Contributor

For issue: #35

  • Need run in javascript
  • Add test

Not cover yet

  • Update config format
  • Use momentum-constructor-common to read momentum file path as default

config = require(path.resolve(configFile));
if (!config) {
config = require(path.resolve(configFile));
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we only read config from _config? Use Object.assign?

Copy link
Contributor Author

@ivanchenhz ivanchenhz Aug 29, 2022

Choose a reason for hiding this comment

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

We still want to support the config file way,
So the user doesn't have to write js, if they prefer cli

@@ -110,7 +117,8 @@ async function init() {
},
tokenPath: '.',
}
await fs.writeFile(configFile, `module.exports = ${JSON.stringify(config, null, 2)}`, 'utf-8');

return _dry ? config : await fs.writeFile(configFile, `module.exports = ${JSON.stringify(config, null, 2)}`, 'utf-8');
Copy link
Member

Choose a reason for hiding this comment

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

Do we need print config if we use dry mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The init would return the config in dry run,
How to use the return stuff would up to the user,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants