Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

215
Vistas
How to pass command line arguments in deno test?

For example:

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

createQRhtml() function takes arguments from command line. Specifically, first argument: Deno.args[0].

How to specify here?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can pass your CLI arguments after a double dash (--) like this:

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));
});

You can learn about the test commmand and other commands in your CLI using the form:

deno help COMMAND_NAME

This is included in the output of deno help test:

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

See also: https://github.com/denoland/deno/issues/8096

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda