docs: recommend WTR over karma (#1862)

Co-authored-by: Pascal Schilp <pascalschilp@gmail.com>
This commit is contained in:
Lars den Bakker
2020-10-04 12:16:28 +02:00
committed by GitHub
parent 9854be827d
commit de68e7b689
10 changed files with 30 additions and 24 deletions

View File

@@ -53,12 +53,6 @@
<li>
<a href="/testing/testing.html" class="{% if permalink == 'testing/testing.html' %}active {% endif %}sidebar-link">Testing library</a>
</li>
<li>
<a href="/testing/testing-karma.html" class="{% if permalink == 'testing/testing-karma.html' %}active {% endif %}sidebar-link">Karma</a>
</li>
<li>
<a href="/testing/testing-karma-bs.html" class="{% if permalink == 'testing/testing-karma-bs.html' %}active {% endif %}sidebar-link">Browserstack</a>
</li>
</ul>
</section>
</li>
@@ -146,9 +140,6 @@
<li>
<a href="/testing/semantic-dom-diff.html" class="{% if permalink == 'testing/semantic-dom-diff.html' %}active {% endif %}sidebar-link">Semantic Dom Diff</a>
</li>
<li>
<a href="/testing/karma-esm.html" class="{% if permalink == 'testing/karma-esm.html' %}active {% endif %}sidebar-link">karma-esm</a>
</li>
</ul>
</section>
</li>

View File

@@ -30,15 +30,15 @@ To set up testing in your project manually, you will need to follow the instruct
To help you get started with testing, we recommend [reading this article](https://dev.to/open-wc/testing-workflow-for-web-components-g73) for a great step by step guide.
## Karma
## Web Test Runner
For testing in the browser, we recommend [Karma](https://karma-runner.github.io/latest/index.html). With Karma, you can run unit tests for our javascript, as well as component tests on the rendered dom elements.
For testing in the browser, we recommend [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/). With Web Test Runner, you can run unit tests on JavaScript code, as well as component tests on the rendered DOM elements.
See the [testing-karma page](https://open-wc.org/testing/testing-karma.html) to learn how to set this up with our default configuration.
See the [this guide](https://modern-web.dev/guides/test-runner/getting-started/) for a step by step guide how to set up the test runner.
## Testing libraries
When testing with karma, we recommend the following libraries:
When testing with web test runner, we recommend the following libraries:
- [mocha](https://mochajs.org/) for setting up the testing structure.
- [chai](https://www.chaijs.com/) for doing assertions
@@ -48,12 +48,6 @@ When testing with karma, we recommend the following libraries:
To use these testing libraries, we recommend [@open-wc/testing](https://open-wc.org/testing/testing.html). This is an opinionated package that combines and configures many of these testing libraries, to minimize the amount of ceremony required to set up tests. For example, it exports chai with plugins already registered.
## Cross-browser testing
To make sure your project is production-ready, we recommend running tests in all the browsers you want to support. If you do not have access to all browsers, we recommend using a service like [Browserstack](https://www.browserstack.com/) to make sure your project works as intended.
Read more at [testing-karma-bs](https://open-wc.org/testing/testing-karma-bs.html) to learn how to set this up with karma.
## Integration testing
A large part of the tests that are traditionally done with selenium can be done with Karma. However, there are still tests that should be run after an application has been deployed. We're still looking for good solutions here, help us improve this documentation by making a pull request!
A large part of the tests that are traditionally done with selenium can be done with Web Test Runner. However, there are still tests that should be run after an application has been deployed. We're still looking for good solutions here, help us improve this documentation by making a pull request!

View File

@@ -1 +0,0 @@
../../packages/karma-esm/README.md

View File

@@ -1 +0,0 @@
../../packages/testing-karma-bs/README.md

View File

@@ -1 +0,0 @@
../../packages/testing-karma/README.md

View File

@@ -6,6 +6,12 @@ tags:
- guides
---
> **Notice**
>
> We have stopped new development of this package.
>
> We will continue to support security patches and bug fixes, but we recommend [web test runner](https://modern-web.dev/docs/test-runner/overview/) for testing web component projects.
# karma-esm
Karma plugin for testing with real es modules without any bundling.

View File

@@ -103,7 +103,7 @@ expect(el.bar).to.equal('baz');
## Customize the fixture container
Ordinarily, `fixture` will render your template as a child of a plain `<div>` element on karma's test runner page:
Ordinarily, `fixture` will render your template as a child of a plain `<div>` element on the test page:
```js
const el = await fixture(html`<my-el></my-el>`);

View File

@@ -6,6 +6,12 @@ tags:
- guides
---
> **Notice**
>
> We have stopped new development of this package.
>
> We will continue to support security patches and bug fixes, but we recommend [web test runner](https://modern-web.dev/docs/test-runner/overview/) for testing web component projects.
# Testing via Browserstack
Configuration for setting up browserstack testing with karma.

View File

@@ -6,6 +6,12 @@ tags:
- guides
---
> **Notice**
>
> We have stopped new development of this package.
>
> We will continue to support security patches and bug fixes, but we recommend [web test runner](https://modern-web.dev/docs/test-runner/overview/) for testing web component projects.
# Testing with Karma
Configuration for setting up testing with karma.

View File

@@ -6,6 +6,12 @@ tags:
- guides
---
> **Notice**
>
> We have stopped new development of this package.
>
> We will continue to support security patches and bug fixes, but we recommend [web test runner](https://modern-web.dev/docs/test-runner/overview/) for testing web component projects.
# Testing in IDE via Wallaby
Wallaby.js is a Plugin for your IDE and runs tests in real time while you are typing.