@@ -19,8 +19,10 @@ import { FolderContext } from "@src/FolderContext";
1919import { WorkspaceContext } from "@src/WorkspaceContext" ;
2020import { Commands } from "@src/commands" ;
2121import { runPlayground } from "@src/commands/runPlayground" ;
22+ import { Playground } from "@src/sourcekit-lsp/extensions" ;
2223import { SwiftTask } from "@src/tasks/SwiftTaskProvider" ;
2324import { TaskManager } from "@src/tasks/TaskManager" ;
25+ import { PlaygroundNode } from "@src/ui/ProjectPanelProvider" ;
2426
2527import { MockedObject , instance , mockObject } from "../../MockUtils" ;
2628import { activateExtensionForSuite , folderInRootWorkspace } from "../utilities/testutilities" ;
@@ -43,14 +45,30 @@ suite("Run Playground Command", function () {
4345 } ) ;
4446
4547 suite ( "Command" , ( ) => {
46- test ( "Succeeds" , async ( ) => {
48+ test ( "Succeeds with PlaygroundItem " , async ( ) => {
4749 expect (
4850 await vscode . commands . executeCommand ( Commands . PLAY , {
4951 id : "PackageLib/PackageLib.swift:3" ,
5052 } )
5153 ) . to . be . true ;
5254 } ) ;
5355
56+ test ( "Succeeds with PlaygroundNode" , async ( ) => {
57+ expect (
58+ await vscode . commands . executeCommand (
59+ Commands . PLAY ,
60+ new PlaygroundNode (
61+ {
62+ label : "foo" ,
63+ id : "PackageLib/PackageLib.swift:3" ,
64+ } as Playground ,
65+ folderContext ,
66+ new Set ( )
67+ )
68+ )
69+ ) . to . be . true ;
70+ } ) ;
71+
5472 test ( "No playground item provided" , async ( ) => {
5573 expect ( await vscode . commands . executeCommand ( Commands . PLAY ) , undefined ) . to . be . false ;
5674 } ) ;
0 commit comments