hapi/lab (and jest): is there a way to have a describe block in a separate js file?

Viewed 81

I am working on a test script using hapi/lab in nodejs. I would like to have a describe block that is using hapi.server to inject http options (to simulate integration testing). Something like:

main.test.js: ...

describe('main', async () => {
   before(async () => {...}

   describe('inner-main', async() => {
      **externalDescribe**(some params that exists in this file)

      it('test specific to this file', async () => {...})
   })
})

externalFile.test.js: ...

function **externalDescribe**(some params) {
  describe('external', async () => {
      it('first it', async () => {
        ...
      })
  })
}

Or something similar.

0 Answers
Related