Skip to content

Commit

Permalink
test: Another tweak to make tests resistant to versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Apr 11, 2018
1 parent b92b8ac commit a9b5663
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion __tests__/__snapshots__/bin.js.snap
Expand Up @@ -17,7 +17,7 @@ exports[`--config 1`] = `
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
<div class='py1 px2'>
<h3 class='mb0 no-anchor'>documentation</h3>
<div class='mb1'><code>6.1.0</code></div>
<div class='mb1'><code>6.2.0</code></div>
<input
placeholder='Filter'
id='filter-input'
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__snapshots__/test.js.snap
Expand Up @@ -839,7 +839,7 @@ exports[`html nested.input.js 1`] = `
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
<div class='py1 px2'>
<h3 class='mb0 no-anchor'>documentation</h3>
<div class='mb1'><code>6.1.0</code></div>
<div class='mb1'></div>
<input
placeholder='Filter'
id='filter-input'
Expand Down
4 changes: 3 additions & 1 deletion __tests__/bin.js
Expand Up @@ -172,7 +172,9 @@ test('--config', async function() {
false
);
let output = fs.readFileSync(outputIndex, 'utf8');
output = output.replace(/documentation \d+\.\d+\.\d+/g, '');
output = output
.replace(/documentation \d+\.\d+\.\d+/g, '')
.replace(/documentation \d+\.\d+\.\d+/g, '');
expect(output).toMatchSnapshot();
});

Expand Down
5 changes: 4 additions & 1 deletion __tests__/test.js
Expand Up @@ -104,7 +104,10 @@ describe('html', function() {
.sort((a, b) => a.path > b.path)
.filter(r => r.path.match(/(html)$/))
.map(r =>
r.contents.toString().replace(/documentation \d+\.\d+\.\d+/g, '')
r.contents
.toString()
.replace(/documentation \d+\.\d+\.\d+/g, '')
.replace(/<code>\d+\.\d+\.\d+<\/code>/g, '')
)
.join('\n');
expect(clean).toMatchSnapshot();
Expand Down

0 comments on commit a9b5663

Please sign in to comment.