Skip to content

Commit

Permalink
feature: @putout/engine-parser: babel: decoratorAutoAccessors
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Sep 22, 2023
1 parent e889c9f commit cac1fde
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/engine-parser/lib/parse.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
'use strict';

const test = require('supertape');
const montag = require('montag');
const tryCatch = require('try-catch');

const parse = require('./parse');
const generate = require('./generate');
const babel = require('./parsers/babel');
Expand All @@ -24,6 +27,26 @@ test('putout: engina-parser: tuple', (t) => {
t.end();
});

test('putout: engina-parser: babel: decoratorAutoAccessors', (t) => {
const source = montag`
class SomeClass {
@setMetadata
foo = 123;
@setMetadata
accessor bar = "hello!";
@setMetadata
baz() { }
}
`;

const [error] = tryCatch(parse, source);

t.notOk(error);
t.end();
});

test('putout: engina-parser: parse + generate = sourcemap', (t) => {
const source = `const hello = 'world';`;

Expand Down
1 change: 1 addition & 0 deletions packages/engine-parser/lib/parsers/babel/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = [
'bigInt',
'classProperties',
'decorators-legacy',
'decoratorAutoAccessors',
'destructuringPrivate',
'exportDefaultFrom',
'throwExpressions',
Expand Down

0 comments on commit cac1fde

Please sign in to comment.