-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathnotes.test.js
More file actions
36 lines (30 loc) · 1.03 KB
/
notes.test.js
File metadata and controls
36 lines (30 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* This file is a part of @mdn/browser-compat-data
* See LICENSE file for more information. */
import assert from 'node:assert/strict';
import { fixNotes } from './notes.js';
describe('fix -> notes', () => {
it('replaces <code> tags with backticks in a string note', () => {
assert.equal(
fixNotes('Before version 90, <code>foo</code> was required.'),
'Before version 90, `foo` was required.',
);
});
it('replaces <code> tags in each note in an array', () => {
assert.deepEqual(
fixNotes([
'Before version 90, <code>foo</code> was required.',
'Use `bar` instead.',
]),
['Before version 90, `foo` was required.', 'Use `bar` instead.'],
);
});
it('leaves notes without <code> tags unchanged', () => {
assert.equal(fixNotes('Use `foo` instead.'), 'Use `foo` instead.');
});
it('does not replace <code> inside backticks', () => {
assert.equal(
fixNotes('The `<code>` element is not supported.'),
'The `<code>` element is not supported.',
);
});
});