Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
¿Cómo pasar argumentos de línea de comando en la prueba deno?

Por ejemplo:

 Deno.test({ name: "Testing qr-html generation", fn: async () => { await createQRhtml(); assertEquals(exists("out/qr.html"), true); } });

La función createQRhtml() toma argumentos de la línea de comandos. Específicamente, primer argumento: Deno.args[0] .

¿Cómo especificar aquí?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede pasar sus argumentos CLI después de un guión doble ( -- ) como este:

 deno test args.test.ts -- hello

args.test.ts :

 import {assert} from 'https://deno.land/std@0.109.0/testing/asserts.ts'; function isHello (str?: unknown): boolean { return str === 'hello'; } Deno.test('First CLI argument is "hello"', () => { const [firstArg] = Deno.args; assert(isHello(firstArg)); });

Puede obtener información sobre el comando de test y otros comandos en su CLI usando el formulario:

 deno help COMMAND_NAME

Esto está incluido en la salida de deno help test :

 USAGE: deno test [OPTIONS] [files]... [-- <SCRIPT_ARG>...]

Ver también: https://github.com/denoland/deno/issues/8096

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!