Skip to content

Commit 0e23b7c

Browse files
committed
test: Another tweak to make tests resistant to versioning
1 parent b92b8ac commit 0e23b7c

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

__tests__/__snapshots__/bin.js.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports[`--config 1`] = `
1717
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
1818
<div class='py1 px2'>
1919
<h3 class='mb0 no-anchor'>documentation</h3>
20-
<div class='mb1'><code>6.1.0</code></div>
20+
<div class='mb1'></div>
2121
<input
2222
placeholder='Filter'
2323
id='filter-input'

__tests__/__snapshots__/test.js.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ exports[`html nested.input.js 1`] = `
839839
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
840840
<div class='py1 px2'>
841841
<h3 class='mb0 no-anchor'>documentation</h3>
842-
<div class='mb1'><code>6.1.0</code></div>
842+
<div class='mb1'></div>
843843
<input
844844
placeholder='Filter'
845845
id='filter-input'

__tests__/bin.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ test('--config', async function() {
172172
false
173173
);
174174
let output = fs.readFileSync(outputIndex, 'utf8');
175-
output = output.replace(/documentation \d+\.\d+\.\d+/g, '');
175+
output = output
176+
.replace(/documentation \d+\.\d+\.\d+/g, '')
177+
.replace(/<code>\d+\.\d+\.\d+<\/code>/g, '');
176178
expect(output).toMatchSnapshot();
177179
});
178180

__tests__/test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ describe('html', function() {
104104
.sort((a, b) => a.path > b.path)
105105
.filter(r => r.path.match(/(html)$/))
106106
.map(r =>
107-
r.contents.toString().replace(/documentation \d+\.\d+\.\d+/g, '')
107+
r.contents
108+
.toString()
109+
.replace(/documentation \d+\.\d+\.\d+/g, '')
110+
.replace(/<code>\d+\.\d+\.\d+<\/code>/g, '')
108111
)
109112
.join('\n');
110113
expect(clean).toMatchSnapshot();

0 commit comments

Comments
 (0)