Skip to content

Commit

Permalink
🐛 Fix @percy/logger test helper unsupported syntax (#266)
Browse files Browse the repository at this point in the history
* 🔨 Use babel overrides to exclude files from presets and plugins

* 🐛 Fix distributed logger test helpers unsupported syntax
  • Loading branch information
Wil Wilsman authored Mar 25, 2021
1 parent 4eb85cf commit 2b2dbcd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
31 changes: 19 additions & 12 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
const pkg = require(`${process.cwd()}/package.json`);
const cwd = process.cwd();
const path = require('path');
const pkg = require(`${cwd}/package.json`);

const base = {
ignore: pkg.files,
presets: [
['@babel/env', {
targets: {
node: '12'
}
}]
],
plugins: [
'@babel/proposal-class-properties'
]
overrides: [{
exclude: pkg.files && (
pkg.files.map(f => (
path.join(cwd, f)
))),
presets: [
['@babel/env', {
targets: {
node: '12'
}
}]
],
plugins: [
'@babel/proposal-class-properties'
]
}]
};

const development = {
Expand Down
2 changes: 1 addition & 1 deletion packages/logger/test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const helpers = {
},

dump() {
if (!helpers.messages?.size) return;
if (!helpers.messages || !helpers.messages.size) return;
if (console.log.and) console.log.and.callThrough();

let write = m => process.env.__PERCY_BROWSERIFIED__
Expand Down

0 comments on commit 2b2dbcd

Please sign in to comment.