mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Remove remnants of '--only' flag in documentation (#22168)
This commit is contained in:
@@ -665,7 +665,6 @@ _bun_test_completion() {
|
|||||||
'--timeout[Set the per-test timeout in milliseconds, default is 5000.]:timeout' \
|
'--timeout[Set the per-test timeout in milliseconds, default is 5000.]:timeout' \
|
||||||
'--update-snapshots[Update snapshot files]' \
|
'--update-snapshots[Update snapshot files]' \
|
||||||
'--rerun-each[Re-run each test file <NUMBER> times, helps catch certain bugs]:rerun' \
|
'--rerun-each[Re-run each test file <NUMBER> times, helps catch certain bugs]:rerun' \
|
||||||
'--only[Only run tests that are marked with "test.only()"]' \
|
|
||||||
'--todo[Include tests that are marked with "test.todo()"]' \
|
'--todo[Include tests that are marked with "test.todo()"]' \
|
||||||
'--coverage[Generate a coverage profile]' \
|
'--coverage[Generate a coverage profile]' \
|
||||||
'--bail[Exit the test suite after <NUMBER> failures. If you do not specify a number, it defaults to 1.]:bail' \
|
'--bail[Exit the test suite after <NUMBER> failures. If you do not specify a number, it defaults to 1.]:bail' \
|
||||||
|
|||||||
@@ -149,12 +149,6 @@ describe.only("only", () => {
|
|||||||
|
|
||||||
The following command will only execute tests #2 and #3.
|
The following command will only execute tests #2 and #3.
|
||||||
|
|
||||||
```sh
|
|
||||||
$ bun test --only
|
|
||||||
```
|
|
||||||
|
|
||||||
The following command will only execute tests #1, #2 and #3.
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ bun test
|
$ bun test
|
||||||
```
|
```
|
||||||
|
|||||||
2
packages/bun-types/test.d.ts
vendored
2
packages/bun-types/test.d.ts
vendored
@@ -423,7 +423,7 @@ declare module "bun:test" {
|
|||||||
options?: number | TestOptions,
|
options?: number | TestOptions,
|
||||||
): void;
|
): void;
|
||||||
/**
|
/**
|
||||||
* Skips all other tests, except this test when run with the `--only` option.
|
* Skips all other tests, except this test.
|
||||||
*/
|
*/
|
||||||
only: Test<T>;
|
only: Test<T>;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -192,7 +192,6 @@ pub const test_only_params = [_]ParamType{
|
|||||||
clap.parseParam("--timeout <NUMBER> Set the per-test timeout in milliseconds, default is 5000.") catch unreachable,
|
clap.parseParam("--timeout <NUMBER> Set the per-test timeout in milliseconds, default is 5000.") catch unreachable,
|
||||||
clap.parseParam("-u, --update-snapshots Update snapshot files") catch unreachable,
|
clap.parseParam("-u, --update-snapshots Update snapshot files") catch unreachable,
|
||||||
clap.parseParam("--rerun-each <NUMBER> Re-run each test file <NUMBER> times, helps catch certain bugs") catch unreachable,
|
clap.parseParam("--rerun-each <NUMBER> Re-run each test file <NUMBER> times, helps catch certain bugs") catch unreachable,
|
||||||
clap.parseParam("--only Only run tests that are marked with \"test.only()\"") catch unreachable,
|
|
||||||
clap.parseParam("--todo Include tests that are marked with \"test.todo()\"") catch unreachable,
|
clap.parseParam("--todo Include tests that are marked with \"test.todo()\"") catch unreachable,
|
||||||
clap.parseParam("--concurrent Treat all tests as `test.concurrent()` tests") catch unreachable,
|
clap.parseParam("--concurrent Treat all tests as `test.concurrent()` tests") catch unreachable,
|
||||||
clap.parseParam("--coverage Generate a coverage profile") catch unreachable,
|
clap.parseParam("--coverage Generate a coverage profile") catch unreachable,
|
||||||
@@ -492,7 +491,6 @@ pub fn parse(allocator: std.mem.Allocator, ctx: Command.Context, comptime cmd: C
|
|||||||
}
|
}
|
||||||
ctx.test_options.update_snapshots = args.flag("--update-snapshots");
|
ctx.test_options.update_snapshots = args.flag("--update-snapshots");
|
||||||
ctx.test_options.run_todo = args.flag("--todo");
|
ctx.test_options.run_todo = args.flag("--todo");
|
||||||
ctx.test_options.only = args.flag("--only");
|
|
||||||
ctx.test_options.concurrent = args.flag("--concurrent");
|
ctx.test_options.concurrent = args.flag("--concurrent");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -225,10 +225,10 @@ describe("bun test", () => {
|
|||||||
expect(stderr).toContain("should run");
|
expect(stderr).toContain("should run");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe("--only", () => {
|
describe("only", () => {
|
||||||
test("should run nested describe.only when enabled", () => {
|
test("should run nested describe.only", () => {
|
||||||
const stderr = runTest({
|
const stderr = runTest({
|
||||||
args: ["--only"],
|
args: [],
|
||||||
input: `
|
input: `
|
||||||
import { test, describe } from "bun:test";
|
import { test, describe } from "bun:test";
|
||||||
describe("outer", () => {
|
describe("outer", () => {
|
||||||
@@ -249,9 +249,9 @@ describe("bun test", () => {
|
|||||||
expect(stderr).not.toContain("unreachable");
|
expect(stderr).not.toContain("unreachable");
|
||||||
expect(stderr.match(/reachable/g)).toHaveLength(1);
|
expect(stderr.match(/reachable/g)).toHaveLength(1);
|
||||||
});
|
});
|
||||||
test("should skip non-only tests when enabled", () => {
|
test("should skip non-only tests", () => {
|
||||||
const stderr = runTest({
|
const stderr = runTest({
|
||||||
args: ["--only"],
|
args: [],
|
||||||
input: `
|
input: `
|
||||||
import { test, describe } from "bun:test";
|
import { test, describe } from "bun:test";
|
||||||
test("test #1", () => {
|
test("test #1", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user