Skip to content

Commit 6069504

Browse files
authored
Merge pull request #23 from speechmarkdown/tucker-alpha
Add more tests for voice
2 parents 433fe7a + 2c85b17 commit 6069504

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "speechmarkdown-js",
3-
"version": "0.8.2-beta.0",
3+
"version": "0.8.2-beta.1",
44
"description": "Speech Markdown parser and formatters in TypeScript.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

tests/sections-standard.spec.ts

+55
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,58 @@ describe('sections-standard end speak tag at end', () => {
177177
});
178178

179179
});
180+
181+
describe('sections-standard voice section on same line', () => {
182+
183+
const speech = new SpeechMarkdown();
184+
185+
const markdown = dedent`
186+
#[voice:'Brian'] Hey there, nice to meet you
187+
`;
188+
189+
test('converts to SSML - Amazon Alexa', () => {
190+
191+
const options = {
192+
platform: 'amazon-alexa'
193+
};
194+
const ssml = speech.toSSML(markdown, options);
195+
196+
const expected = dedent`
197+
<speak>
198+
199+
<voice name="Brian"> Hey there, nice to meet you</voice>
200+
201+
</speak>
202+
`;
203+
204+
expect(ssml).toBe(expected);
205+
});
206+
207+
test('converts to SSML - Google Assistant', () => {
208+
209+
const options = {
210+
platform: 'google-assistant'
211+
};
212+
const ssml = speech.toSSML(markdown, options);
213+
214+
const expected = dedent`
215+
<speak>
216+
Hey there, nice to meet you
217+
</speak>
218+
`;
219+
220+
expect(ssml).toBe(expected);
221+
});
222+
223+
test('converts to Plain Text', () => {
224+
225+
const options = {
226+
};
227+
const text = speech.toText(markdown, options);
228+
229+
const expected = ' Hey there, nice to meet you';
230+
231+
expect(text).toBe(expected);
232+
});
233+
234+
});

0 commit comments

Comments
 (0)