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

257
Views
What is the name of the unit test naming convention that is prefixed with "#" and "." in the test names?

I've seen some tests written this way and I would like to know if anyone knows what is the name of this convention:

describe("users/domains/services/user-service", () => {
  describe("UserService", () => {
    describe(".create()", () => {
      ...
    });

   describe(".update()", () => {
      ...
   });
    
    // Static method
    describe("#new()", () => {
      ...
    });
  });
});

If someone can help me I would be very grateful.

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

0

This way of referring to a method or variable comes from jsdoc and is called a namepath. For example, MyClass#myMethod could be used in a doc comment to refer the method named #myMethod in the class named MyClass.

The use of this convention for JavaScript tests is very prominent in the mocha.js documentation. An equivalent style has also been proposed by betterspecs.org as a best practice in Ruby, and there's some discussion about it there. I don't know who first adopted the style, and I don't think it has a name.

There's some more relevant answers in this related StackOverflow question.

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!