You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/docs/building/rollup-plugin-html.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -242,7 +242,7 @@ export default {
242
242
243
243
### Minification
244
244
245
-
Set the minify option to do default HTML minificiation. If you need custom options, you can implement your own minifier using the `transformHtml` option.
245
+
Set the minify option to do default HTML minification. If you need custom options, you can implement your own minifier using the `transformHtml` option.
Copy file name to clipboardexpand all lines: docs/docs/building/rollup-plugin-import-meta-assets.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ Default: `null`
88
88
By default, referenced assets detected by this plugin are just copied as is to the output directory, according to your configuration.
89
89
90
90
When `transform` is defined, this function will be called for each asset with two parameters, the content of the asset as a [Buffer](https://nodejs.org/api/buffer.html) and the absolute path.
91
-
This allows you to conditionnaly match on the absolute path and maybe transform the content.
91
+
This allows you to conditionally match on the absolute path and maybe transform the content.
92
92
93
93
When `transform` returns `null`, the asset is skipped from being processed.
Copy file name to clipboardexpand all lines: docs/docs/dev-server/plugins/esbuild.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ The `auto-always` option looks at the user agent, but doesn't skip the latest ve
76
76
77
77
### Browser and language target
78
78
79
-
The target option can be set to one or more browser or language targetversions, for example `chrome80` or `es2020`. The property can be an array, so you can set multiple browser targets. While the auto target options are specific to this plugin, the browser and language target come directly from esbuild. [Check the docs](https://github.com/evanw/esbuild) for more information.
79
+
The target option can be set to one or more browser or language target versions, for example `chrome80` or `es2020`. The property can be an array, so you can set multiple browser targets. While the auto target options are specific to this plugin, the browser and language target come directly from esbuild. [Check the docs](https://github.com/evanw/esbuild) for more information.
Copy file name to clipboardexpand all lines: docs/docs/test-runner/browser-launchers/saucelabs.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Install the package:
12
12
npm i --save-dev @web/test-runner-saucelabs
13
13
```
14
14
15
-
Add the browser launcher to your `web-test-runner.confg.mjs`. To set up a local proxy to sauce labs, you first need to create the browser launcher which will share a common connection between all browsers:
15
+
Add the browser launcher to your `web-test-runner.config.mjs`. To set up a local proxy to sauce labs, you first need to create the browser launcher which will share a common connection between all browsers:
Copy file name to clipboardexpand all lines: docs/docs/test-runner/commands.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -334,7 +334,7 @@ it('natively holds and then releases a key', async () => {
334
334
335
335
### Select option
336
336
337
-
The `selectOption` command allows you to select an option in a `<select>` tag by either a single value, a label string or as multiple values, depending on the specific implementations of the browser laucher you're using. Once selected, the native `change` and `input` events are dispatched automatically. The `selectOption` command needs the CSS selector to locate the `<select>` by and the value, label, or values to select. The function is async and should be awaited.
337
+
The `selectOption` command allows you to select an option in a `<select>` tag by either a single value, a label string or as multiple values, depending on the specific implementations of the browser launcher you're using. Once selected, the native `change` and `input` events are dispatched automatically. The `selectOption` command needs the CSS selector to locate the `<select>` by and the value, label, or values to select. The function is async and should be awaited.
338
338
339
339
The three major launchers all have different support for selecting options, and the `selectOption` takes this into account.Attempting to select an option via a method that is not implemented in the provided launcher will produce errors. Each supported launcher's option selection support is documented below.
Copy file name to clipboardexpand all lines: docs/docs/test-runner/writing-tests/code-coverage.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Web Test Runner uses [`v8-to-istanbul`](https://github.com/istanbuljs/v8-to-ista
35
35
/* c8 ignore next [line count] */
36
36
```
37
37
38
-
This is somewhat different than other tools where you might have specifically targetted`if` / `else` branches of logic with an ignore statement. Particularly, V8 does not create phantom `else` statements when calculating coverage, so it is likely that you will be able to use less of these statements than in the past.
38
+
This is somewhat different than other tools where you might have specifically targeted`if` / `else` branches of logic with an ignore statement. Particularly, V8 does not create phantom `else` statements when calculating coverage, so it is likely that you will be able to use less of these statements than in the past.
Copy file name to clipboardexpand all lines: docs/guides/dev-server/using-plugins.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,7 @@ export default {
103
103
104
104
## Babel
105
105
106
-
When doing buildless development you want compilers to be as fast as possible. That's why we recommend esbuild for common transformatons like TS, JSX, and modern JS. [See our guide](./typescript-and-jsx.md) to learn more about how to set this up.
106
+
When doing buildless development you want compilers to be as fast as possible. That's why we recommend esbuild for common transformations like TS, JSX, and modern JS. [See our guide](./typescript-and-jsx.md) to learn more about how to set this up.
107
107
108
108
If you need to use babel because of a specific plugin, you can use `@rollup/plugin-babel`. In this example we use babel with the JSX plugin for preact:
Copy file name to clipboardexpand all lines: docs/guides/test-runner/code-coverage/index.md
+8-7
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ export function calc(type, a, b) {
44
44
```
45
45
46
46
And while we are at it we can also add `minus`, I'm sure that will come in handy that at some point as well.
47
-
And if we provide a wrong type we should throw an error - better let the user know whats up.
47
+
And if we provide a wrong type we should throw an error - better let the user know what's up.
48
48
49
49
👉 `src/calc.js`
50
50
@@ -74,7 +74,7 @@ View full coverage report at coverage/lcov-report/index.html
74
74
Finished running tests in 1s, all tests passed! 🎉
75
75
```
76
76
77
-
As you can see, our test passed but our `Code coverage` is a bit on the low side.
77
+
As you can see, our test passed but our code coverage is a bit on the low side.
78
78
79
79
## What to test
80
80
@@ -103,7 +103,7 @@ Adding a test for throwing an error will bring it to `100%`.
103
103
## Adding more features
104
104
105
105
Let's add the possibility to `multiply`.
106
-
While implementing`Lea` said it's time for a meeting so we put `return; // finish later` for now.
106
+
While implementing, Lea said it's time for a meeting so we put `return; // finish later` for now.
107
107
108
108
👉 `src/calc.js`
109
109
@@ -149,11 +149,12 @@ View full coverage report at coverage/lcov-report/index.html
149
149
Finished running tests in 1s, all tests passed! 🎉
150
150
```
151
151
152
-
uh nice `100%` - but it feels fishy? didn't we have a `finish later` somewhere?
152
+
Uh, nice `100%` - but it feels fishy? Didn't we have a `finish later` somewhere?
153
153
154
154
## How come we have 100% code coverage?
155
155
156
-
Lets first try to understand how code coverage works
156
+
Let's first try to understand how code coverage works.
157
+
157
158
The way code coverage gets measured is by applying a form of instrumentation. In short, before our code is executed it gets changed (instrumented) and it behaves something like this:
158
159
159
160
```js
@@ -162,7 +163,7 @@ if (this.value === 'cat') {
162
163
console.log('We like cats too :)');
163
164
}
164
165
165
-
// becomes something like this (psoido code)
166
+
// becomes something like this (pseudo code)
166
167
__instrumented['functionUpdate'] +=1;
167
168
if (this.value==='cat') {
168
169
__instrumented['functionUpdateBranch1yes'] +=1;
@@ -208,7 +209,7 @@ You should, therefore, see code coverage as a tool that only gives you guidance
208
209
209
210
## Ignoring uncovered lines
210
211
211
-
In more complex applications, it is likely that you will find yourself creating difficult, if not impossible, to test branches of functionality. While this can absolutely be a pointer to logic that is worth breaking down into more approachable parts, there will be cases where this is not feasible. If so, you may chose to ignore a line of code by using the `/* c8 ignore next */` custom comment. Using this, or more advanced forms of [ignoring uncovered lines](../../../docs/test-runner/writing-tests/code-coverage.md#ignoring-uncovered-lines) while computing code coverage can go a long way in preparing your project for long term maintanence.
212
+
In more complex applications, it is likely that you will find yourself creating difficult, if not impossible, to test branches of functionality. While this can absolutely be a pointer to logic that is worth breaking down into more approachable parts, there will be cases where this is not feasible. If so, you may chose to ignore a line of code by using the `/* c8 ignore next */` custom comment. Using this, or more advanced forms of [ignoring uncovered lines](../../../docs/test-runner/writing-tests/code-coverage.md#ignoring-uncovered-lines) while computing code coverage can go a long way in preparing your project for long term maintenance.
Copy file name to clipboardexpand all lines: docs/guides/test-runner/typescript.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,10 @@
3
3
If you write your source files in TypeScript, you can test directly from sources without
4
4
compiling using `tsc`. Add `esbuildPlugin({ ts: true })` to your `web-test-runner.config.js`
5
5
file.
6
+
6
7
This uses esbuild to [transform TS sources on-the-fly](https://esbuild.github.io/api/#transform-api).
7
8
[There are some caveats to using esbuild with TypeScript](https://esbuild.github.io/content-types/#typescript-caveats).
9
+
8
10
For example, if you use TypeScript paths to alias imports, you may need to build first.
9
11
10
12
```js
@@ -16,8 +18,8 @@ export default {
16
18
};
17
19
```
18
20
19
-
Keep in mind that esbuild merely removes TypeScript syntax and transforms decorators, etc;
20
-
It does not provide any type checking, and it's [not intended to](https://esbuild.github.io/faq/#upcoming-roadmap). If you'd like to run `tsc` in parallel, you can use `concurrently` or `npm-run-all`
21
+
Keep in mind that esbuild merely removes TypeScript syntax and transforms decorators, etc.;
22
+
It does not provide any type checking and it's [not intended to](https://esbuild.github.io/faq/#upcoming-roadmap). If you'd like to run `tsc` in parallel, you can use `concurrently` or `npm-run-all`.
21
23
22
24
<figure>
23
25
@@ -33,4 +35,4 @@ Example: Using `concurrently` to typecheck and test simultaneously
33
35
34
36
</figure>
35
37
36
-
Read more about the esbuild plugin in the [docs](../../docs/dev-server/plugins/esbuild.md)
38
+
Read more about the esbuild plugin in the [docs](../../docs/dev-server/plugins/esbuild.md).
0 commit comments