Skip to content

Commit

Permalink
Update to latest flow parser, enable enums parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
gkz committed May 7, 2020
1 parent 48355d9 commit d18f6a5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions parser/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
const flowParser = require('flow-parser');

const defaultOptions = {
enums: true,
esproposal_class_instance_fields: true,
esproposal_class_static_fields: true,
esproposal_decorators: true,
Expand Down
16 changes: 14 additions & 2 deletions src/__tests__/Worker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,19 @@ describe('Worker API', () => {
});
});

});

it(`can parse enums with flow`, done => {
const transformPath = getTransformForParser('flow');
const sourcePath = createTempFileWith(
'enum E {A, B}'
);
const emitter = worker([transformPath]);

emitter.send({files: [sourcePath]});
emitter.once('message', (data) => {
expect(data.status).toBe('ok');
expect(getFileContent(sourcePath)).toBe('changed');
done();
});
});
});
});
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1667,9 +1667,9 @@ flatted@^2.0.0:
integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==

flow-parser@0.*:
version "0.113.0"
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.113.0.tgz#5b5913c54833918d0c3136ba69f6cf0cdd85fc20"
integrity sha512-+hRyEB1sVLNMTMniDdM1JIS8BJ3HUL7IFIJaxX+t/JUy0GNYdI0Tg1QLx8DJmOF8HeoCrUDcREpnDAc/pPta3w==
version "0.124.0"
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.124.0.tgz#b0ff07cba91ffe5f58a95867fb86cf0d1bdc37ff"
integrity sha512-ftEG23+ieFYxpBnwJXLZiSmAjrtVU7J2NmEqv7OZbwPWgqsqKsSD73RwBxdEFhUdyfvceDRZ7GbQrYZJ0YKuFg==

for-in@^1.0.1, for-in@^1.0.2:
version "1.0.2"
Expand Down

0 comments on commit d18f6a5

Please sign in to comment.