Skip to content

test: add confDir test and fix linting in integration spec#184

Merged
viferga merged 7 commits intometacall:masterfrom
p4rthh:feat/confdir-test
Dec 26, 2025
Merged

test: add confDir test and fix linting in integration spec#184
viferga merged 7 commits intometacall:masterfrom
p4rthh:feat/confdir-test

Conversation

@p4rthh
Copy link
Contributor

@p4rthh p4rthh commented Dec 19, 2025

Description

This PR adds an integration test for the --confDir flag (src/test/confDir.spec.ts).

Changes

  • Added src/test/confDir.spec.ts to verify the flag functionality.
  • Applied npm run fix to src/test/cli.integration.spec.ts to resolve upstream linter errors (Tabs vs Spaces) as discussed in Discord.

Notes

The cli.integration.spec.ts logic remains unchanged; only formatting was updated to pass the linter.

@viferga
Copy link
Member

viferga commented Dec 19, 2025

@p4rthh I just checked the test and the flag --confDir is not being tested. The test should be something like this:

The test in general is good, specially the before and after callbacks, but it should pass the --confDir with the proper token to see if it logins accordingly. It's fine to set it up on a empty folder so it does not deploy, but we can verify that is login properly with a config on a different folder.

@viferga
Copy link
Member

viferga commented Dec 19, 2025

If you test like you are doing, you skip the whole purpose of testing --confDir like in here:

const config = await startup(args['confDir']);

args['confDir'] is what should be tested, not startup, that's why I prefer if we do integration test directly with the flag.

@viferga
Copy link
Member

viferga commented Dec 26, 2025

@p4rthh I have done two more changes, I have restored exactly how the TODO comments were before. It's important to be atomic whenever possible and don't change things in a commit that are unrelated, even if it is just spaces and nothing changed.

The other thing I have changed is the writeFileSync, I made it async. I am going to squash the commits into one but you can check the final code to see the differences.

@viferga viferga merged commit 6627acd into metacall:master Dec 26, 2025
1 check passed
@viferga
Copy link
Member

viferga commented Dec 26, 2025

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