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

test: minor login test cleanup #569

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

rossiam
Copy link
Collaborator

@rossiam rossiam commented Dec 5, 2023

I want to do at least a little more clean-up of these tests but have limited this PR because of the indentation changes due to the removal of the top-level describe.

  • remove superfluous top-level describe
  • mock delay function from util to wait 10ms

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project (npm run lint produces no warnings/errors)

Copy link

changeset-bot bot commented Dec 5, 2023

⚠️ No Changeset found

Latest commit: b0dd11e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -11,6 +11,8 @@ import ora, { Ora } from 'ora'

import { Authenticator } from '@smartthings/core-sdk'

import { delay } from '../../lib/util.js'
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this need to be dynamically imported in order to be mocked?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think you're confusing this with the import for the file under test, which we do have to dynamically import after setting up the mocks. The only reason I'm even including this and its ilk is so I can use them with typeof to get the types of the mock correct. (In this case, the const delayMock: jest.Mock<typeof delay> = jest.fn() line.)

@rossiam rossiam merged commit 793f850 into SmartThingsCommunity:yargs Dec 6, 2023
4 checks passed
@rossiam rossiam deleted the login-test-updates-1 branch December 6, 2023 15:41
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.

None yet

2 participants