-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
}) | ||
); | ||
$$.SANDBOX.stub(fs.promises, 'readFile') | ||
.withArgs('testing') |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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.
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