Skip to content

Commit f74f895

Browse files
committed
actually fix extractor API tests
1 parent a23a4c0 commit f74f895

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/_example-extractor/src/api.spec.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,26 @@ bar
99
`;
1010

1111
const EXPECTED: IExtractedCode = {
12-
foreign_code: 'bar',
12+
foreign_code: 'bar\n',
1313
host_code: EXAMPLE,
1414
range: { end: { column: 0, line: 2 }, start: { column: 0, line: 1 } },
1515
virtual_shift: null
1616
};
1717

18+
const NOT_EXPECTED: IExtractedCode = {
19+
foreign_code: null,
20+
host_code: 'baz',
21+
range: null,
22+
virtual_shift: null
23+
};
24+
1825
describe('The foo extractor', () => {
1926
it('extracts %%foo bar', () => {
2027
const extracted = extractor.extract_foreign_code(EXAMPLE);
21-
expect(extracted[0]).to.equal(EXPECTED);
28+
expect(extracted).to.equal([EXPECTED]);
2229
});
2330
it('does not extract baz', () => {
2431
const extracted = extractor.extract_foreign_code('baz');
25-
expect(extracted).to.equal([]);
32+
expect(extracted).to.equal([NOT_EXPECTED]);
2633
});
2734
});

0 commit comments

Comments
 (0)