@@ -232,7 +232,7 @@ describe("pickExtensionPackModelFile", () => {
232232 label : "codeql-custom-queries-java" ,
233233 path : tmpDir . path ,
234234 } as QuickPickItem ) ;
235- showInputBoxSpy . mockResolvedValueOnce ( "new-extension-pack" ) ;
235+ showInputBoxSpy . mockResolvedValueOnce ( "pack/ new-extension-pack" ) ;
236236 showInputBoxSpy . mockResolvedValue ( "models/my-model.yml" ) ;
237237
238238 expect (
@@ -247,7 +247,7 @@ describe("pickExtensionPackModelFile", () => {
247247 extensionPack : {
248248 path : newPackDir ,
249249 yamlPath : join ( newPackDir , "codeql-pack.yml" ) ,
250- name : "new-extension-pack" ,
250+ name : "pack/ new-extension-pack" ,
251251 version : "0.0.0" ,
252252 extensionTargets : {
253253 "codeql/java-all" : "*" ,
@@ -280,7 +280,7 @@ describe("pickExtensionPackModelFile", () => {
280280 expect (
281281 loadYaml ( await readFile ( join ( newPackDir , "codeql-pack.yml" ) , "utf8" ) ) ,
282282 ) . toEqual ( {
283- name : "new-extension-pack" ,
283+ name : "pack/ new-extension-pack" ,
284284 version : "0.0.0" ,
285285 library : true ,
286286 extensionTargets : {
@@ -303,7 +303,7 @@ describe("pickExtensionPackModelFile", () => {
303303 label : "codeql-custom-queries-java" ,
304304 path : tmpDir . path ,
305305 } as QuickPickItem ) ;
306- showInputBoxSpy . mockResolvedValueOnce ( "new-extension-pack" ) ;
306+ showInputBoxSpy . mockResolvedValueOnce ( "pack/ new-extension-pack" ) ;
307307 showInputBoxSpy . mockResolvedValue ( "models/my-model.yml" ) ;
308308
309309 expect (
@@ -321,7 +321,7 @@ describe("pickExtensionPackModelFile", () => {
321321 extensionPack : {
322322 path : newPackDir ,
323323 yamlPath : join ( newPackDir , "codeql-pack.yml" ) ,
324- name : "new-extension-pack" ,
324+ name : "pack/ new-extension-pack" ,
325325 version : "0.0.0" ,
326326 extensionTargets : {
327327 "codeql/csharp-all" : "*" ,
@@ -354,7 +354,7 @@ describe("pickExtensionPackModelFile", () => {
354354 expect (
355355 loadYaml ( await readFile ( join ( newPackDir , "codeql-pack.yml" ) , "utf8" ) ) ,
356356 ) . toEqual ( {
357- name : "new-extension-pack" ,
357+ name : "pack/ new-extension-pack" ,
358358 version : "0.0.0" ,
359359 library : true ,
360360 extensionTargets : {
@@ -806,6 +806,12 @@ describe("pickExtensionPackModelFile", () => {
806806 "Invalid package name: a pack name must contain only lowercase ASCII letters, ASCII digits, and hyphens" ,
807807 ) ;
808808 expect ( await validateFile ( "VSCODE" ) ) . toEqual (
809+ "Invalid package name: a pack name must contain a slash to separate the scope from the pack name" ,
810+ ) ;
811+ expect ( await validateFile ( "github/" ) ) . toEqual (
812+ "Invalid package name: a pack name must contain only lowercase ASCII letters, ASCII digits, and hyphens" ,
813+ ) ;
814+ expect ( await validateFile ( "github/VSCODE" ) ) . toEqual (
809815 "Invalid package name: a pack name must contain only lowercase ASCII letters, ASCII digits, and hyphens" ,
810816 ) ;
811817 expect ( await validateFile ( "github/vscode-codeql-" ) ) . toEqual (
@@ -814,7 +820,7 @@ describe("pickExtensionPackModelFile", () => {
814820 expect (
815821 await validateFile ( "github/vscode-codeql-extensions" ) ,
816822 ) . toBeUndefined ( ) ;
817- expect ( await validateFile ( "vscode-codeql-extensions" ) ) . toBeUndefined ( ) ;
823+ expect ( await validateFile ( "pack/ vscode-codeql-extensions" ) ) . toBeUndefined ( ) ;
818824 } ) ;
819825
820826 it ( "validates the file input" , async ( ) => {
0 commit comments