0

I am using minimist to run different environment for my TestSuite using test cafe however i am facing some issues

I have the following example.ts file

import * as minimist from 'minimist';

const args = minimist(process.argv.slice(2))
const environment = args.env

fixture('example')
 .page("https://example.com")

test('check environment', async t => {
  console.log('Environment:', environment);

   if(environment =='Test')
   {
    console.log('Environment:', environment);

   }

   
   else if(environment=='Stage')
   {
    console.log('Environment:', environment);
    
   }
});

and the below command line package.json

"minitest":"testcafe chrome:headless scripts/example.ts --env=Test"

when I run "npm run minitest" I get the below error, what am I doing wrong?

error: unknown option '--env=Test'
npm ERR! code 1
Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
TS0306
  • 177
  • 12

0 Answers0