Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit37b5b53

Browse files
committed
setup test runner filter
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent42aa940 commit37b5b53

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

‎src/editor/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const createCommands = ({ extensionPath, workspaceState }: CreateCommandP
5151
webview.createOrShow()
5252
},
5353
[COMMANDS.CONFIG_TEST_RUNNER]:async(config:TT.TestRunnerConfig)=>{
54-
constsetup=config.setup||config.actions// TODO:depreacte and remove config.actions
54+
constsetup=config.setup||config.actions// TODO:deprecate and remove config.actions
5555
if(setup){
5656
// setup tutorial test runner commits
5757
// assumes git already exists

‎src/services/testRunner/index.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,15 @@ interface Callbacks {
1818
constfailChannelName='CodeRoad (Tests)'
1919
constlogChannelName='CodeRoad (Logs)'
2020

21+
interfaceTestRunnerParams{
22+
position:T.Position
23+
filter?:string
24+
onSuccess?:()=>void
25+
}
26+
2127
constcreateTestRunner=(config:TT.TestRunnerConfig,callbacks:Callbacks)=>{
22-
returnasync(position:T.Position,onSuccess?:()=>void):Promise<void>=>{
28+
consttestRunnerFilterArg=config.args?.filter
29+
returnasync({ position,filter:testFilter, onSuccess}:TestRunnerParams):Promise<void>=>{
2330
logger('createTestRunner',position)
2431
conststartTime=throttle()
2532
// throttle time early
@@ -34,7 +41,16 @@ const createTestRunner = (config: TT.TestRunnerConfig, callbacks: Callbacks) =>
3441

3542
letresult:{stdout:string|undefined;stderr:string|undefined}
3643
try{
37-
constcommand=config.args ?`${config.command}${config?.args.tap}` :config.command// TODO: enforce TAP
44+
letcommand=config.args ?`${config.command}${config?.args.tap}` :config.command// TODO: enforce TAP
45+
46+
// filter tests if requested
47+
if(testRunnerFilterArg){
48+
if(testFilter){
49+
command+=`${testRunnerFilterArg}${testFilter}`
50+
}else{
51+
thrownewError('Test Runner filter not configured')
52+
}
53+
}
3854
result=awaitexec({ command,dir:config.directory||config.path})// TODO: remove config.path later
3955
}catch(err){
4056
result={stdout:err.stdout,stderr:err.stack}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp