Skip to content

Commit 433fe7a

Browse files
authoredJul 9, 2019
Merge pull request #22 from speechmarkdown/tucker-alpha
Add special chars tests
2 parents ff777ec + c6e8212 commit 433fe7a

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
 

‎tests/modifier-text-allowed-chars.spec.ts

+55
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,58 @@ describe.skip('modifier-text-allowed-chars minus sign', () => {
5656
});
5757

5858
});
59+
60+
describe.skip('modifier-text-allowed-chars special chars', () => {
61+
62+
const speech = new SpeechMarkdown();
63+
64+
const markdown = dedent`
65+
This is text with (parens) but this and other special characters: []()*~@#\\_!+- are ignored
66+
`;
67+
68+
test('converts to SSML - Amazon Alexa', () => {
69+
70+
const options = {
71+
platform: 'amazon-alexa'
72+
};
73+
const ssml = speech.toSSML(markdown, options);
74+
75+
const expected = dedent`
76+
<speak>
77+
This is text with (parens) but this and other special characters: []()*~@#\\_!+- are ignored
78+
</speak>
79+
`;
80+
81+
expect(ssml).toBe(expected);
82+
});
83+
84+
test('converts to SSML - Google Assistant', () => {
85+
86+
const options = {
87+
platform: 'google-assistant'
88+
};
89+
const ssml = speech.toSSML(markdown, options);
90+
91+
const expected = dedent`
92+
<speak>
93+
This is text with (parens) but this and other special characters: []()*~@#\\_!+- are ignored
94+
</speak>
95+
`;
96+
97+
expect(ssml).toBe(expected);
98+
});
99+
100+
test('converts to Plain Text', () => {
101+
102+
const options = {
103+
};
104+
const text = speech.toText(markdown, options);
105+
106+
const expected = dedent`
107+
This is text with (parens) but this and other special characters: []()*~@#\\_!+- are ignored
108+
`;
109+
110+
expect(text).toBe(expected);
111+
});
112+
113+
});

0 commit comments

Comments
 (0)