2

I use Cypress with custom commands and test cases.

I want to define some global enums in a file, e. g.:

enum MyEnum{
    A = "hello",
    B = "goodbye"
}

Now I want to use this enum in every file without import like this:

Cypress.Commands.add('testCommand', () =>
{
   let myEnum = MyEnum.A;
})

or:

describe("example", () =>
{  
    it("example", () =>
    {
        let myEnum = MyEnum.A;
    });
});

Is this possible?

ses
  • 168
  • 1
  • 11
  • Does this answer your question? [How to configure custom global interfaces (.d.ts files) for TypeScript?](https://stackoverflow.com/questions/42233987/how-to-configure-custom-global-interfaces-d-ts-files-for-typescript) – Mikhail Bolotov Sep 16 '21 at 12:11

0 Answers0