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

refactor: devScripts update #646

Merged
merged 6 commits into from
Jun 5, 2023
Merged

refactor: devScripts update #646

merged 6 commits into from
Jun 5, 2023

Conversation

svc-cli-bot
Copy link
Contributor

@svc-cli-bot svc-cli-bot commented Jun 4, 2023

created via github action [skip-validate-pr].

Tests were broken that were stubbing fs.readFile indiscriminately (that's now used during alias stuff in testSteup).

That also uncovered a test that wasn't doing what it said it was, so I also changed the test/assertions

@svc-cli-bot svc-cli-bot added the dependencies Pull requests that update a dependency file label Jun 4, 2023
})
);
$$.SANDBOX.stub(fs.promises, 'readFile')
.withArgs('testing')
Copy link
Contributor

Choose a reason for hiding this comment

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

only change readFile for the file you care about

$$.SANDBOX.stub(fs.promises, 'readFile').resolves(JSON.stringify(readsFile));
if (typeof readsFile !== 'boolean') {
const fsStub = $$.SANDBOX.stub(fs.promises, 'readFile');
fsStub.withArgs('parent/child/file.json').resolves(JSON.stringify(readsFile));
Copy link
Contributor

Choose a reason for hiding this comment

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

only changes readFile for the file it needs to stub. callThrough lets the original implementation work in other cases.

@@ -163,6 +173,8 @@ describe('org:create:user', () => {
testOrg.username,
'--target-dev-hub',
'[email protected]',
'--definition-file',
Copy link
Contributor

Choose a reason for hiding this comment

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

test says it's testing override of file, but wasn't using the file contents.

@mshanemc mshanemc merged commit 275dddd into main Jun 5, 2023
@mshanemc mshanemc deleted the devScripts2023-06-04 branch June 5, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants