Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cungminh2710 committed Nov 19, 2023
1 parent 9f7959f commit 960c6e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
);

expect(mergedOutput).toContain(`import { MyEnum } from './enums'`);
expect(mergedOutput).toContain(`export { MyEnum }`);
expect(mergedOutput).toContain(`export type { MyEnum }`);
expect(mergedOutput).toContain(ENUM_RESOLVERS_SIGNATURE);
expect(mergedOutput).toContain('EnumResolverSignature');
expect(mergedOutput).toContain(
Expand Down
14 changes: 7 additions & 7 deletions packages/plugins/typescript/typescript/tests/typescript.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3623,7 +3623,7 @@ describe('TypeScript', () => {
)) as Types.ComplexPluginOutput;

expect(result.content).not.toContain(`export enum MyEnum`);
expect(result.content).toContain(`export { MyEnum }`);
expect(result.content).toContain(`export type { MyEnum };`);
expect(result.prepend).toContain(`import MyEnum = NS.ETest;`);
expect(result.prepend).toContain(`import { NS } from './my-file';`);

Expand All @@ -3640,7 +3640,7 @@ describe('TypeScript', () => {
)) as Types.ComplexPluginOutput;

expect(result.content).not.toContain(`export enum MyEnum`);
expect(result.content).toContain(`export { MyEnum };`);
expect(result.content).toContain(`export type { MyEnum };`);
expect(result.prepend).toContain(`import MyEnum = NS.MyEnum;`);
expect(result.prepend).toContain(`import { NS } from './my-file';`);

Expand All @@ -3658,7 +3658,7 @@ describe('TypeScript', () => {

expect(result.content).not.toContain(`export enum MyEnum`);
expect(result.prepend).toContain(`import { MyCustomEnum as MyEnum } from './my-file';`);
expect(result.content).toContain(`export { MyEnum };`);
expect(result.content).toContain(`export type { MyEnum };`);

validateTs(result);
});
Expand Down Expand Up @@ -3689,8 +3689,8 @@ describe('TypeScript', () => {
{ outputFile: '' }
)) as Types.ComplexPluginOutput;

expect(result.content).toContain(`export { MyEnum };`);
expect(result.content).toContain(`export { MyEnum2 };`);
expect(result.content).toContain(`export type { MyEnum };`);
expect(result.content).toContain(`export type { MyEnum2 };`);
expect(result.prepend).toContain(`import { MyEnum2X as MyEnum2 } from './my-file';`);

validateTs(result);
Expand All @@ -3707,8 +3707,8 @@ describe('TypeScript', () => {

expect(result.prepend).toContain(`import { MyEnum } from './my-file';`);
expect(result.prepend).toContain(`import { MyEnum2 } from './my-file';`);
expect(result.content).toContain(`export { MyEnum };`);
expect(result.content).toContain(`export { MyEnum2 };`);
expect(result.content).toContain(`export type { MyEnum };`);
expect(result.content).toContain(`export type { MyEnum2 };`);

validateTs(result);
});
Expand Down

0 comments on commit 960c6e4

Please sign in to comment.