From d7e323036b28617fa79386a0be045da787c9dfd6 Mon Sep 17 00:00:00 2001 From: Giancarlo Anemone Date: Tue, 17 Dec 2019 13:04:41 -0500 Subject: [PATCH] Fix flow and tests https://github.com/uber-web/thrift2flow/pull/101 --- src/__tests__/typedefs.test.js | 4 +--- src/main/convert.js | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/__tests__/typedefs.test.js b/src/__tests__/typedefs.test.js index b54d62d..188acff 100644 --- a/src/__tests__/typedefs.test.js +++ b/src/__tests__/typedefs.test.js @@ -135,12 +135,10 @@ test('typedef reserved type', () => { const root = tmp.dirSync().name; const p = path.resolve(root, 'types.thrift'); fs.writeFileSync(p, `typedef string Symbol`); - let output = new ThriftFileConverter(p, true).generateFlowFile(); + let output = new ThriftFileConverter(p, false).generateFlowFile(); expect(output).toMatchInlineSnapshot(` "// @flow -// Source: /var/folders/sz/v9gcp6kx09g3b49qqnll68lc0000gp/T/tmp-35121caTR4AtzFmXM/types.thrift - export type _Symbol = string; " `); diff --git a/src/main/convert.js b/src/main/convert.js index 8ab5f92..b5bb085 100644 --- a/src/main/convert.js +++ b/src/main/convert.js @@ -276,6 +276,7 @@ export class ThriftFileConverter { )};`; } if (def.value.type === 'Identifier') { + // $FlowFixMe return `export const ${id(def.id.name)} = ${id(def.value.name)}`; } }