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

New: Introduce Jest component testing to the framework (fixes #3417) #3383

Merged
merged 21 commits into from
Sep 26, 2023

Conversation

eleanor-heath
Copy link
Contributor

@eleanor-heath eleanor-heath commented Mar 31, 2023

Please see details here #3417

Steps to run
Navigate to the adapt_framework repo in the terminal and run

# to setup
npm install

# to see help screen
npm test help

# to execute
npm test

Copy link
Contributor

Choose a reason for hiding this comment

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

👀

@cahirodoherty-learningpool cahirodoherty-learningpool force-pushed the Framework-unit-testing branch 2 times, most recently from 2b04abc to b3f0dce Compare May 16, 2023 15:19
@eleanor-heath eleanor-heath force-pushed the Framework-unit-testing branch from 559fc12 to b3f0dce Compare May 17, 2023 12:48
Eleanor Heath added 2 commits May 17, 2023 13:59
…t, added spy on isMinScreenSize to test different screen sizes, added jest to eslintrc and added extra clearjest cache command
…reenSize is no longer in use within the header template
@eleanor-heath eleanor-heath changed the title Issue#64/Introduce Jest component testing to the framework Feature: Issue#64/Introduce Jest component testing to the framework May 17, 2023
@oliverfoster
Copy link
Member

Update

Commands

image

Test file layouts

  1. Cypress/e2e tests should live in each plugin at the folder test/e2e/name.cy.js
  2. Jest/unit tests should live in each plugin at the folder test/unit/name.js
  3. Jest global mocks should live at test/unit/__mock__/name.js
    image

See example test folder.

Notes

I've moved all of the code for executing tests into test.js to keep things very simple and the testing architecture out of the test definition folders.

Libraries

jest-environment-adapt contains all of the code required to setup jest to be able to load Adapt into node.

Copy link
Contributor

Choose a reason for hiding this comment

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

👀
Excellent!

@eleanor-heath
Copy link
Contributor Author

Approved ✅ extremely happy with this and great we will now have both e2e and unit tests within the Adapt Framework.

@cahirodoherty-learningpool cahirodoherty-learningpool merged commit c83f68b into master Sep 26, 2023
1 check passed
@cahirodoherty-learningpool cahirodoherty-learningpool deleted the Framework-unit-testing branch September 26, 2023 09:01
github-actions bot pushed a commit that referenced this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants