Skip to content

Commit

Permalink
Merge pull request #23 from speechmarkdown/tucker-alpha
Browse files Browse the repository at this point in the history
Add more tests for voice
  • Loading branch information
rmtuckerphx authored Jul 15, 2019
2 parents 433fe7a + 2c85b17 commit 6069504
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "speechmarkdown-js",
"version": "0.8.2-beta.0",
"version": "0.8.2-beta.1",
"description": "Speech Markdown parser and formatters in TypeScript.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
55 changes: 55 additions & 0 deletions tests/sections-standard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,58 @@ describe('sections-standard end speak tag at end', () => {
});

});

describe('sections-standard voice section on same line', () => {

const speech = new SpeechMarkdown();

const markdown = dedent`
#[voice:'Brian'] Hey there, nice to meet you
`;

test('converts to SSML - Amazon Alexa', () => {

const options = {
platform: 'amazon-alexa'
};
const ssml = speech.toSSML(markdown, options);

const expected = dedent`
<speak>
<voice name="Brian"> Hey there, nice to meet you</voice>
</speak>
`;

expect(ssml).toBe(expected);
});

test('converts to SSML - Google Assistant', () => {

const options = {
platform: 'google-assistant'
};
const ssml = speech.toSSML(markdown, options);

const expected = dedent`
<speak>
Hey there, nice to meet you
</speak>
`;

expect(ssml).toBe(expected);
});

test('converts to Plain Text', () => {

const options = {
};
const text = speech.toText(markdown, options);

const expected = ' Hey there, nice to meet you';

expect(text).toBe(expected);
});

});

0 comments on commit 6069504

Please sign in to comment.