3
3
load ("@aspect_rules_ts//ts:defs.bzl" , "ts_project" )
4
4
load ("@npm//:vitest/package_json.bzl" , vitest_bin = "bin" )
5
5
6
- def vitest (name , srcs = [], deps = [], size = "small" , flaky = False , tags = [], no_copy_to_bin = [], fixtures = [], dom = False , snapshots = [], skip_typecheck = False , ** kwargs ):
6
+ def vitest (name , srcs = [], deps = [], size = "small" , flaky = False , tags = [], no_copy_to_bin = [], fixtures = [], dom = False , snapshots = [], skip_typecheck = False , timeout = None , ** kwargs ):
7
7
"""
8
8
A rule to define a vitest target.
9
9
@@ -19,6 +19,7 @@ def vitest(name, srcs = [], deps = [], size = "small", flaky = False, tags = [],
19
19
fixtures (list, optional): A list of fixture files for the target. Defaults to an empty list.
20
20
dom (bool, optional): Whether to run the test in a DOM environment. Defaults to False.
21
21
skip_typecheck (bool, optional): Whether to skip typechecking. Defaults to False.
22
+ timeout (str, optional): Custom timeout for the test in milliseconds. Defaults to None.
22
23
**kwargs: Additional keyword arguments.
23
24
"""
24
25
@@ -52,6 +53,6 @@ def vitest(name, srcs = [], deps = [], size = "small", flaky = False, tags = [],
52
53
no_copy_to_bin = no_copy_to_bin ,
53
54
args = [
54
55
"run" ,
55
- ] + (["--dom" ] if dom else []),
56
+ ] + (["--dom" ] if dom else []) + ([ "--test-timeout" , timeout ] if timeout else []) ,
56
57
** kwargs
57
58
)
0 commit comments