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

Integrate Karma Infrastructure #48

Merged
merged 10 commits into from
Jul 29, 2021
Merged

Integrate Karma Infrastructure #48

merged 10 commits into from
Jul 29, 2021

Conversation

rajsite
Copy link
Member

@rajsite rajsite commented Jul 27, 2021

Pull Request

🤨 Rationale

Introduces karma test infrastructure for writing unit tests. Modeled after the integration in fast foundation.

This does not integrate the playwright-based FAST e2e testing framework.

👩‍💻 Implementation

Migrated a similar karma configuration as used in FAST with some differences:

Some other minor refactors included in this change:

  • Created an eslint config at the root to lint config js files for karma, storybook, etc. Currently disabled for storybook to address in a follow-up.
  • Enabled the importsNotUsedAsValues TypeScript compiler rule for nimble components. This is helpful as nimble components currently relies on side-effects of imports and as a result of enabling the rule it becomes explicit when an import is done for side-effects instead of just for type imports, ie import './someFile'; (note how there are no named imports, just side-effects).

🧪 Testing

Included a sample test file for the Button based on existing FastFoundation tests. Does not represent what the Button tests should cover but is just used as an example to test the infrastructure. In a follow-up the example tests should be replaced with tests for Nimble Button specific features (currently just appearance configuration).

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

packages/nimble-components/package.json Outdated Show resolved Hide resolved
packages/nimble-components/package.json Show resolved Hide resolved
packages/nimble-components/package.json Show resolved Hide resolved
packages/nimble-components/CONTRIBUTING.md Outdated Show resolved Hide resolved
packages/nimble-components/CONTRIBUTING.md Outdated Show resolved Hide resolved
packages/nimble-components/CONTRIBUTING.md Outdated Show resolved Hide resolved
packages/nimble-components/karma.conf.js Show resolved Hide resolved
packages/nimble-components/src/.eslintrc.js Show resolved Hide resolved
packages/nimble-components/src/button/button.spec.ts Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
packages/nimble-components/CONTRIBUTING.md Outdated Show resolved Hide resolved
@rajsite
Copy link
Member Author

rajsite commented Jul 29, 2021

@jattasNI resetting you as there was some big folder structure changes and to check the fixture docs

@rajsite rajsite requested a review from jattasNI July 29, 2021 02:01
packages/nimble-components/CONTRIBUTING.md Outdated Show resolved Hide resolved
packages/nimble-components/src/button/button.spec.ts Outdated Show resolved Hide resolved
@rajsite rajsite merged commit c2ecbdd into main Jul 29, 2021
@rajsite rajsite deleted the karma-test-components branch July 29, 2021 17:46
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.

5 participants