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

Integration of Karma testing framework #173

Merged
merged 31 commits into from
Jul 21, 2021

Conversation

jakublala
Copy link
Contributor

Integrating karma instead of jsdom to actually run the tests in a browser so that WebGL works (and one can thus write tests for the Viewer or the Map).

@jakublala
Copy link
Contributor Author

Also, I added a test for the Viewer so that one can actually see that the WebGL stuff works with karma.

@jakublala jakublala requested a review from Luthaf July 9, 2021 11:34
.github/workflows/tests.yml Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
tests/karma.conf.ts Outdated Show resolved Hide resolved
tests/karma.conf.ts Outdated Show resolved Hide resolved
tests/map/options.test.ts Outdated Show resolved Hide resolved
tests/structure/grid.test.ts Outdated Show resolved Hide resolved
tests/structure/grid.test.ts Outdated Show resolved Hide resolved
tests/structure/grid.test.ts Outdated Show resolved Hide resolved
tests/karma.conf.ts Outdated Show resolved Hide resolved
jakublala and others added 5 commits July 9, 2021 14:22
Co-authored-by: Guillaume Fraux <luthaf@luthaf.fr>
Co-authored-by: Guillaume Fraux <luthaf@luthaf.fr>
@Luthaf
Copy link
Contributor

Luthaf commented Jul 9, 2021

I have an issue when trying to run the tests locally:

09 07 2021 14:30:59.759:ERROR [karma-server]: Error: ENOENT: no such file or directory, open '/var/folders/v6/c9ym3wnn4c3c2t3r9sv4v02h0000gn/T/_karma_webpack_713295/../../../../../../Users/guillaume/code/chemiscope/dist/src/structure/grid.d.ts'

I'd guess this is related to webpack or karma configuration, I'll check what's going on

Copy link
Contributor

@Luthaf Luthaf left a comment

Choose a reason for hiding this comment

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

I'm happy with the current state of this, could we make sure the new test framework works for everyone before merging? @rosecers @ceriottm and @cbenmahm could you checkout this branch locally & check that existing tests pass (running npm test)

.gitignore Outdated Show resolved Hide resolved
package.json Outdated
"karma-firefox-launcher": "^2.1.1",
"karma-mocha": "^2.0.1",
"karma-safari-launcher": "^1.0.0",
"karma-webpack": "git+https://github.com/ryanclark/karma-webpack#ef7edb6b6756fb563871eaff88ca876892694896",
Copy link
Contributor

Choose a reason for hiding this comment

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

I had to use the latest master commit, since it contains some un-released changes that fix another issue I had with karma-webpack (codymikol/karma-webpack#453 (comment))

Copy link
Contributor

Choose a reason for hiding this comment

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

incredibly, works on my system

tests/structure/grid.test.ts Outdated Show resolved Hide resolved
@Luthaf Luthaf merged commit e28f276 into lab-cosmo:master Jul 21, 2021
@Luthaf
Copy link
Contributor

Luthaf commented Jul 21, 2021

I though I already merged this 😄 Well, now it is done!

jakublala added a commit to jakublala/chemiscope that referenced this pull request Jul 21, 2021
author Jakub Lála <68380659+jakublala@users.noreply.github.com> 1626864006 +0200
committer Jakub Lála <jakublala@gmail.com> 1626892362 +0200

parent 9eacadc
author Jakub Lála <68380659+jakublala@users.noreply.github.com> 1626864006 +0200
committer Jakub Lála <jakublala@gmail.com> 1626892347 +0200

parent 9eacadc
author Jakub Lála <68380659+jakublala@users.noreply.github.com> 1626864006 +0200
committer Jakub Lála <jakublala@gmail.com> 1626892324 +0200

Use Karma to run unit tests (lab-cosmo#173)

Previously tests would run on node, and we would mimic a browser environment with JSDom, but the limitations of this approach were too big.

Karma allows to run the tests in real browsers, which is where chemiscope runs in practice

Temp Commit

Changed .gitIgnore

temp commit

temp commit

Added Karma

Viewer test added

Remove coverage files

Moved files / Changed chrome launcher

setup-chrome driver attempt

Revert previosu commit

Update .github/workflows/tests.yml

Co-authored-by: Guillaume Fraux <luthaf@luthaf.fr>

Enacted on suggestions

Day 1 commit

temp commit

Added a few unit tests for Map Options

One more
@jakublala jakublala deleted the karma-testing-framework branch July 21, 2021 18:34
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.

3 participants