Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77d2a9c

Browse files
committed
add failing hint tests to fix later
1 parent c9f4d4a commit 77d2a9c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

test/hint.spec.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,40 @@ describe('@hint', () => {
9999
});
100100
});
101101

102+
it('should work with a second opening bracket', () => {
103+
const lines = ['+ Task One', '', "@hint('an example with a bracket ( in the middle')"];
104+
const next = task({ result: result(), lines, index: index() });
105+
const nextTask = next.pages[0].tasks[0];
106+
expect(nextTask).to.deep.equal({
107+
hints: [
108+
'an example with a bracket ( in the middle'
109+
],
110+
description: 'Task One\n'
111+
});
112+
});
113+
114+
it('should work with a curly bracket', () => {
115+
const lines = ['+ Task One', '', "@hint('an example with a bracket { in the middle')"];
116+
const next = task({ result: result(), lines, index: index() });
117+
const nextTask = next.pages[0].tasks[0];
118+
expect(nextTask).to.deep.equal({
119+
hints: [
120+
'an example with a bracket { in the middle'
121+
],
122+
description: 'Task One\n'
123+
});
124+
});
125+
126+
it('should work with a closing bracket', () => {
127+
const lines = ['+ Task One', '', "@hint('an example with a bracket ) in the middle')"];
128+
const next = task({ result: result(), lines, index: index() });
129+
const nextTask = next.pages[0].tasks[0];
130+
expect(nextTask).to.deep.equal({
131+
hints: [
132+
'an example with a bracket ) in the middle'
133+
],
134+
description: 'Task One\n'
135+
});
136+
});
137+
102138
}); // @hint

0 commit comments

Comments
 (0)