Comparing version 1.0.4 to 1.0.5
@@ -109,2 +109,12 @@ 'use strict' | ||
const text = function (text) { | ||
if (typeof text !== 'string') { | ||
throw TypeError(`[smsg#text] 'text' must be a string.`) | ||
} | ||
return { | ||
text: text | ||
} | ||
} | ||
module.exports = { | ||
@@ -116,3 +126,4 @@ _attachment: _attachment, | ||
postback: postback, | ||
text: text, | ||
web_url: web_url | ||
} |
{ | ||
"name": "smsg", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A simple library for constructing structured messages for the Messenger Platform Send API.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -232,2 +232,12 @@ const { expect } = require('chai') | ||
describe('smsg#text', function () { | ||
it('returns a valid text message', function () { | ||
let x = smsg.text('this is text') | ||
expect(x).to.deep.equal({ | ||
text: 'this is text' | ||
}) | ||
}) | ||
}) | ||
describe('smsg#web_url', function () { | ||
@@ -234,0 +244,0 @@ it('returns a valid web_url button', function () { |
15302
337