Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Test Driven Development For Lambda

Test Driven Development For Lambda

堀家隆宏

August 09, 2017
Tweet

More Decks by 堀家隆宏

Other Decks in Technology

Transcript

  1. "1*(BUFXBZͷΠϯςάϨʔγϣϯςετྫ IUUQTHJUIVCDPNIPSJLFTFSWFSMFTTBQJJOUFHSBUJPOUFTUTBNQMF σϓϩΠ ࡟আ ςετ beforeAll(() => { Utils.deployService(); });

    it('should return correct values from all apis', () => { const testEndpoint = `${endpoint}/hello`; return fetch(testEndpoint, { method: 'GET' }) .then(response => response.json()) .then((json) => expect(json.message).to.equal(‘Go function successfully!')); }); afterAll(() => { Utils.removeService(); }); });
  2. ϞοΫΛ࡞Δྫ const dynamoDbGetStub = sinon.stub(proxyDynamoDB.prototype,’get').returns( {promise: () => { return

    Promise.resolve({ Item: { post_title: 'aa', post_content: 'bb' } }) }}) %ZOBNP%#%PDVNFOU$MJFOUHFU QSPNJTF  ͷฦΓ஋Λࢦఆ -BNCEBͷϢχοτςετϕετϓϥΫςΟε
 IUUQRJJUBDPNIPSJLFJUFNTGGCDBF