Skip to content

Add jasmine-browser-runner #13765

Merged
nathan-barrett merged 7 commits into
mainfrom
13423-jasmine-browser-runner
Oct 16, 2023
Merged

Add jasmine-browser-runner #13765
nathan-barrett merged 7 commits into
mainfrom
13423-jasmine-browser-runner

Conversation

@nathan-barrett

@nathan-barrett nathan-barrett commented Oct 9, 2023

Copy link
Copy Markdown
Contributor

One-line summary

Adding jasmine-browser-runner as a replacement for Karma as the test runner for JS test specs

Significant changes and points to review

  • All references to Karma have been removed from bedrock
  • All tests pass (and aren't giving false positives)

Issue / Bugzilla link

#13423

Testing

npm run test

@nathan-barrett nathan-barrett linked an issue Oct 10, 2023 that may be closed by this pull request
1 task
@nathan-barrett nathan-barrett marked this pull request as ready for review October 10, 2023 18:45
@nathan-barrett nathan-barrett added Needs Review Awaiting code review Review: S Code review time: 30 mins to 1 hour labels Oct 10, 2023
@nathan-barrett

Copy link
Copy Markdown
Contributor Author

Few open questions I had while working on this:

  • Do we also need to test in Chrome as well as firefox?
  • is dist/ an ok place to keep the js bundles?

@nathan-barrett nathan-barrett force-pushed the 13423-jasmine-browser-runner branch from fb5802a to f1d3077 Compare October 10, 2023 21:10

@alexgibson alexgibson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is looking great, I'm glad we managed to get it working!

A couple of minor points below, and maybe we can get it to run in Chrome as well using a second config file? Other than that I'm glad this seems to have been less painful then it first seemed :)

Comment thread package.json Outdated
Comment thread webpack.test.config.js Outdated
Comment thread webpack.test.config.js Outdated
Comment thread tests/unit/jasmine-browser.json
@alexgibson alexgibson removed the Needs Review Awaiting code review label Oct 11, 2023

@alexgibson alexgibson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

r+wc - works great!

Comment thread package.json Outdated
Comment thread docs/testing.rst
* ``/unit`` contains the Jasmine tests and Karma config file.
* ``/unit`` contains the Jasmine tests and Jasmine Browser Runner config file.

Installation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it worth adding a note in the docs that people will need both geckodriver and chromedriver installed locally before running the tests?

There's already a bit under functional testing that talks about how to install geckodriver: https://bedrock.readthedocs.io/en/latest/testing.html#running-functional-tests

Perhaps we could re-purpose this at the top of the doc, saying both geckodriver and chromedriver are a dependency for running both JS and functional tests locally?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, good call out.

Comment thread package.json

@alexgibson alexgibson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

r+wc

Comment thread docs/testing.rst Outdated

brew install geckodriver

To download chromedriver and have it ready to run in your system, there are a couple of ways:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This all looks good, but it's in the functional tests section of the document, which comes after the Jasmine instructions. Sorry if I wasn't clear, but I was suggesting we could put this information at the top of the file, as a requirement for running both Jasmine and functional tests, so that people would read it before getting to the Jasmine instructions. Does that make sense?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yup, my mistake!

@nathan-barrett nathan-barrett force-pushed the 13423-jasmine-browser-runner branch from 7107ac3 to 78a2bd8 Compare October 16, 2023 16:57
@nathan-barrett nathan-barrett merged commit 166678d into main Oct 16, 2023
@nathan-barrett nathan-barrett deleted the 13423-jasmine-browser-runner branch October 16, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review: S Code review time: 30 mins to 1 hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate from Karma to jasmine-browser-runner

2 participants