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

Update getConfiguration stubs to use .withArgs(settingId) instead of .callsFake #656

Open
shouples opened this issue Nov 21, 2024 · 0 comments
Assignees
Labels
cleanup General refactoring and/or minor adjustments needed that shouldn't impact overall functionality good first issue Good for newcomers testing Involves the test suite, click-testing, or CI processes

Comments

@shouples
Copy link
Contributor

shouples commented Nov 21, 2024

Makes reading through tests a bit easer.

.withArgs:

const mockConfig = {
get: sandbox.stub().withArgs(SSL_PEM_PATHS).returns(["path/to/pem"]),
};

.callsFake:

const mockConfig = {
get: sandbox.stub().callsFake((key: string) => {
if (key === SSL_PEM_PATHS) return ["path/to/file.pem"];
}),
};

@shouples shouples added cleanup General refactoring and/or minor adjustments needed that shouldn't impact overall functionality testing Involves the test suite, click-testing, or CI processes labels Nov 21, 2024
@shouples shouples self-assigned this Nov 21, 2024
@shouples shouples added the good first issue Good for newcomers label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup General refactoring and/or minor adjustments needed that shouldn't impact overall functionality good first issue Good for newcomers testing Involves the test suite, click-testing, or CI processes
Projects
None yet
Development

No branches or pull requests

1 participant