Skip to content

Commit

Permalink
Tests: Also accept error messages referencing /var/folders so that th…
Browse files Browse the repository at this point in the history
…e test suite works on a mac
  • Loading branch information
papandreou committed Apr 25, 2021
1 parent d3d98ea commit a9c348a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/magicPenMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,11 @@ describe('magicpen-media', () => {
.clone('text')
.image('data:image/png;base64,AQID', { fallbackToDisc: true })
.toString();
expect(text, 'to match', /^\/tmp\/.* \(image\/png\)$/);
expect(
text,
'to match',
/^\/(?:tmp|var\/folders)\/.* \(image\/png\)$/
);
const fileName = text.split(' ')[0];

expect(fs.statSync(fileName), 'to satisfy', {
Expand All @@ -410,7 +414,7 @@ describe('magicpen-media', () => {
.clone('text')
.image(new Uint8Array([1, 2, 3]), { fallbackToDisc: true })
.toString();
expect(text, 'to match', /^\/tmp\/.* \(image\)$/);
expect(text, 'to match', /^\/(?:tmp|var\/folders)\/.* \(image\)$/);
const fileName = text.split(' ')[0];

expect(fs.statSync(fileName), 'to satisfy', {
Expand All @@ -425,7 +429,7 @@ describe('magicpen-media', () => {
.clone('text')
.image(Buffer.from([1, 2, 3]), { fallbackToDisc: true })
.toString();
expect(text, 'to match', /^\/tmp\/.* \(image\)/);
expect(text, 'to match', /^\/(?:tmp|var\/folders)\/.* \(image\)/);
const fileName = text.split(' ')[0];

expect(fs.statSync(fileName), 'to satisfy', {
Expand Down

0 comments on commit a9c348a

Please sign in to comment.