I have created multiple test-suites and want them to run under a single test suite or a single describe test block. I have placed them like...
describe('',()=>{  
  require('test-suite1.test.ts')
  require('test-suite2.test.ts')
  require('test-suite3.test.ts')
  ...
  ....
}
Can anyone suggest me anyother way to replace the require and still run all the test under single test suite?
The layout of your tests can be something like this:
describe('All of the functions from this file', () => {
  describe('first function', () => {
    test('first function test one', () => {
      // ... tests for the first function
    });
    test('first function test two', () => {
      // ... tests for the first function
    });
    test('first function test three', () => {
      // ... tests for the first function
    });
  });
  describe('second function', () => {
    test('second function test one', () => {
      // ... tests for the second function
    });
    test('second function test two', () => {
      // ... tests for the second function
    });
    test('second function test three', () => {
      // ... tests for the second function
    });
  });
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With