-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resolve import collisions for enums (#341)
Similar to #339. Also fixes generated functions
- Loading branch information
Showing
8 changed files
with
210 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
import { Simple } from './simple'; | ||
import { Simple, SimpleEnum as LocalSimpleEnum, SimpleEnums } from './simple'; | ||
import { SimpleEnum as ImportSimpleEnum } from './simple2'; | ||
|
||
describe('simple', () => { | ||
it('generates types correctly', () => { | ||
const simple = Simple.fromPartial({}); | ||
describe('Simple', () => { | ||
it('type checking works correctly for interfaces', () => { | ||
const simple: Simple = { | ||
name: 'foo', | ||
otherSimple: { | ||
name: 'bar', | ||
age: 1, | ||
}, | ||
} | ||
}); | ||
}); | ||
|
||
it('type checking works correctly for enums', () => { | ||
const simpleEnum: SimpleEnums = { | ||
localEnum: LocalSimpleEnum.LOCAL_BAR, | ||
importEnum: ImportSimpleEnum.IMPORT_FOO, | ||
} | ||
}); | ||
}) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters