Skip to content

Commit

Permalink
browser extension: fix tests on circle by adding babel class properti…
Browse files Browse the repository at this point in the history
…es plugin

fixes https://app.circleci.com/pipelines/github/snarfed/bridgy/475/workflows/25180b19-02bd-4eba-8016-492bb4c0996c/jobs/1583 :

```
    SyntaxError: /root/project/browser-extension/common.js: Support for the experimental syntax 'classProperties' isn't currently enabled (38:3):

      36 | class Silo {
      37 |   DOMAIN     // eg 'silo.com'
    > 38 |   NAME       // eg 'instagram'
         |   ^
      39 |   BASE_URL   // eg 'https://silo.com'
      40 |   LOGIN_URL  // eg 'https://silo.com/login'
      41 |   COOKIE     // eg 'sessionid'

    Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.
    If you want to leave it as-is, add @babel/plugin-syntax-class-properties (https://git.io/vb4yQ) to the 'plugins' section to enable parsing.
```
  • Loading branch information
snarfed committed Feb 12, 2021
1 parent 3329cd0 commit 8ce1095
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions browser-extension/babel.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Needed for Jest to support async/await
// https://jestjs.io/docs/en/tutorial-async#asyncawait
// Babel config
// https://babeljs.io/docs/en/configuration#babelconfigjson
// https://babeljs.io/docs/en/options
{
presets: [["@babel/preset-env", {targets: {node: "current"}}]]
// Needed for Jest to support async/await
// https://jestjs.io/docs/en/tutorial-async#asyncawait
presets: [["@babel/preset-env", {targets: {node: "current"}}]],

// Needed for experimental class property syntax
// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields
// https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-propertise
"plugins": ["@babel/plugin-proposal-class-properties"]
}

0 comments on commit 8ce1095

Please sign in to comment.