Skip to content

Commit

Permalink
Merge pull request #1035 from fkettelhoit/fix-cmd-test-docs
Browse files Browse the repository at this point in the history
Fix example commands in docs broken by PR #851
  • Loading branch information
drager authored Aug 7, 2021
2 parents 34d8aa9 + b242938 commit 67a543f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions docs/src/commands/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ wasm-pack build examples/js-hello-world --mode no-install

## Extra options

The `build` command can pass extra options straight to `cargo build` even if they are not
supported in wasm-pack. To use them you should add standalone `--` argument at the very
end of your command, and all the arguments you want to pass to cargo should go after.
For example, to build the previous example using cargo's offline feature:
The `build` command can pass extra options straight to `cargo build` even if
they are not supported in wasm-pack. To use them simply add the extra arguments
at the very end of your command, just as you would for `cargo build`. For
example, to build the previous example using cargo's offline feature:

```
wasm-pack build examples/js-hello-world --mode no-install -- --offline
wasm-pack build examples/js-hello-world --mode no-install --offline
```

<hr style="font-size: 1.5em; margin-top: 2.5em"/>
Expand Down
12 changes: 6 additions & 6 deletions docs/src/commands/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ wasm-pack test --node --firefox --chrome --safari --headless
The `test` command can pass extra options straight to `cargo test` even if they are not
supported in wasm-pack.

To use them you should add standalone `--` argument at the very
end of your command, and all the arguments you want to pass to cargo should go after.
To use them simply add the extra arguments at the very end of your command, just
as you would for `cargo test`.

`cargo test -h` for a list of all options that you can pass through.

Expand All @@ -72,16 +72,16 @@ $ tree crates/foo

```
# Run all tests in tests/diff_patch.rs in Firefox
wasm-pack test crates/foo --firefox --headless -- --test diff_patch
wasm-pack test crates/foo --firefox --headless --test diff_patch
# Run all tests in tests/diff_patch.rs that contain the word "replace"
wasm-pack test crates/foo --firefox --headless -- --test diff_patch replace
wasm-pack test crates/foo --firefox --headless --test diff_patch replace
# Run all tests inside of a `tests` module inside of src/lib/diff.rs
wasm-pack test crates/foo --firefox --headless -- --lib diff::tests
wasm-pack test crates/foo --firefox --headless --lib diff::tests
# Same as the above, but only if they contain the word replace
wasm-pack test crates/foo --firefox --headless -- --lib diff::tests::replace
wasm-pack test crates/foo --firefox --headless --lib diff::tests::replace
```

Note that you can also filter tests by location in which they're supposed to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ allocator, but only if the `wee_alloc` feature is enabled at compile time. The
feature can be enabled by passing extra options while building:

```
$ wasm-pack build -- --features wee_alloc
$ wasm-pack build --features wee_alloc
```

or alternatively you could turn it on by default in `Cargo.toml`:
Expand Down

0 comments on commit 67a543f

Please sign in to comment.