mardi 9 juin 2020

How to start serverless-offline in mocha test before function

I'd like to use serverless-offline in some mocha tests. Something like:

describe('run some tests', function() {
  before(function(done) {
    // Start serverless-offline here
    return done();
  });

  after(function(done) {
    // Stop serverless-offline here
    return done();
  });

  it('run the test against serverless-offline', function(done) {
    // test code here
    return done();
  });
});

Is there a way to start serverless-offline programatically rather than via the cli? Or some other way to run tests on serverless functions offline?

Aucun commentaire:

Enregistrer un commentaire