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

150
Vistas
How to not include mocha (TDD) functions like "describe" and "it" in my src folder and only contain them in test folder? [TS]

Mocha.js functions like describe() and it() are available everywhere in my project, but I only want them to be only accessible and callable in my "test" folder. Is there any way to do that?

P.S. I'm using typescript if that makes a difference.

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

0

I think your question is really vague. Still I am going to try to answer assming that you use eslint...

In your .eslintrc.js (or eslint config file), you may have:

module.exports = {
  env: {
    browser: true,
    es6: true,
    node: true,
    mocha: true
   }
   (...)

Where you should have:

module.exports = {
  env: {
    browser: false,
    es6: true,
    node: true
  },

  (...)

  overrides: [
    {
      files: 'test/**/*.spec.js',
      env: {
        mocha: true,
      },
    },
  ],
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