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

160
Views
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 answers
Answer question

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 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!