File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import test from "ava" ;
2+
3+ import { ConfigurationError } from "../util" ;
4+
5+ import { parseRemoteFileAddress , RemoteFileAddress } from "./remote-file" ;
6+
7+ test ( "expandConfigFileInput accepts full remote addresses" , async ( t ) => {
8+ t . deepEqual ( parseRemoteFileAddress ( "owner/repo/path@ref" ) , {
9+ owner : "owner" ,
10+ repo : "repo" ,
11+ path : "path" ,
12+ ref : "ref" ,
13+ } satisfies RemoteFileAddress ) ;
14+
15+ t . deepEqual (
16+ parseRemoteFileAddress ( "owner/repo/path/to/codeql.yml@ref/feature" ) ,
17+ {
18+ owner : "owner" ,
19+ repo : "repo" ,
20+ path : "path/to/codeql.yml" ,
21+ ref : "ref/feature" ,
22+ } satisfies RemoteFileAddress ,
23+ ) ;
24+ } ) ;
25+
26+ test ( "expandConfigFileInput rejects invalid values" , async ( t ) => {
27+ t . throws ( ( ) => parseRemoteFileAddress ( " " ) , {
28+ instanceOf : ConfigurationError ,
29+ } ) ;
30+ t . throws ( ( ) => parseRemoteFileAddress ( "repo:/absolute" ) , {
31+ instanceOf : ConfigurationError ,
32+ } ) ;
33+ t . throws ( ( ) => parseRemoteFileAddress ( "repo:file.yml:unexpected" ) , {
34+ instanceOf : ConfigurationError ,
35+ } ) ;
36+ } ) ;
You can’t perform that action at this time.
0 commit comments