Skip to content

Commit

Permalink
Test the hello lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
rricard committed Nov 29, 2015
1 parent 860fd19 commit 076ac79
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/hello.js
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,24 @@
import assert from "assert";

import {lambdaPromisifier} from "../lib/lambda-promisifier.js"
import {hello} from "../lambdas/hello.js"

const promisifiedHello = lambdaPromisifier(hello);

describe("hello lambda", function() {
it("should greet the world by default", function(done) {
promisifiedHello({})
.then(res => {
assert.equal(res, "Hello world!")
})
.then(() => done(), done);
});

it("should greet someone when precised", function(done) {
promisifiedHello({name: "someone"})
.then(res => {
assert.equal(res, "Hello someone!")
})
.then(() => done(), done);
});
});

0 comments on commit 076ac79

Please sign in to comment.