11import { join } from 'node:path' ;
22import ms from 'ms' ;
33import execa from 'execa' ;
4- import { writeJSON } from 'fs-extra' ;
54import fetch from 'node-fetch' ;
65
7- const vercelFileName = 'test.vercel.json' ;
8- const pkgRootFile = `file:${ process . cwd ( ) } ` ;
96const readyRegex = / R e a d y ! \s + A v a i l a b l e a t (?< url > h t t p s ? : \/ \/ \w + : \d + ) / ;
107
118jest . setTimeout ( ms ( '50m' ) ) ;
129
13- interface Config {
14- builds : {
15- use : string ;
16- } [ ] ;
17- }
18-
1910interface Probe {
2011 path : string ;
2112 status ?: number ;
@@ -30,19 +21,6 @@ async function importJSON<T>(path: string): Promise<T> {
3021 return ( await import ( path ) ) as unknown as Promise < T > ;
3122}
3223
33- async function injectConf ( confPath : string ) : Promise < Config > {
34- const conf = await importJSON < Config > ( join ( confPath , vercelFileName ) ) ;
35-
36- conf . builds [ 0 ] . use = pkgRootFile ;
37-
38- await writeJSON ( join ( confPath , 'vercel.json' ) , conf , {
39- spaces : 2 ,
40- EOL : '\n' ,
41- } ) ;
42-
43- return conf ;
44- }
45-
4624async function checkProbes ( baseUrl : string , probes : Probe [ ] ) : Promise < void > {
4725 for ( const probe of probes ) {
4826 // eslint-disable-next-line no-await-in-loop
@@ -121,4 +99,7 @@ describe('vercel-rust', () => {
12199 it ( 'deploy 05-with-similar-entrypaths' , async ( ) => {
122100 await expect ( testFixture ( '05-with-similar-entrypaths' ) ) . resolves . toBe ( 'ok' ) ;
123101 } ) ;
102+ it ( 'deploy 06-with-toolchain-override' , async ( ) => {
103+ await expect ( testFixture ( '06-with-toolchain-override' ) ) . resolves . toBe ( 'ok' ) ;
104+ } ) ;
124105} ) ;
0 commit comments