Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add separate test files for transform mode and feature testing #52

Closed
wants to merge 2 commits into from

Conversation

mertcanaltin
Copy link
Member

Add separate test files for transform mode and feature testing 46

  • Created transform-mode.test.js to test general transformation mode functionalities, including async/await and ES6 module transformations.
  • Added transform-feature.test.js to verify handling of specific ECMAScript features such as class fields and private class fields.
  • Introduced transform-decorator-namespace.test.js to test TypeScript-specific features like decorators and namespaces.

@mertcanaltin mertcanaltin force-pushed the dev-45 branch 2 times, most recently from 9326c04 to e6b7cd0 Compare August 9, 2024 11:24
@mertcanaltin mertcanaltin changed the title feat: Add separate test files for transform mode and feature testing test: add separate test files for transform mode and feature testing Aug 9, 2024
Copy link
Member

@marco-ippolito marco-ippolito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove tests that are not meaningful

@mertcanaltin
Copy link
Member Author

Please remove tests that are not meaningful

thank you for the review I will fix it today

@mertcanaltin mertcanaltin force-pushed the dev-45 branch 3 times, most recently from 0f7162d to e11a5a7 Compare August 10, 2024 22:07
@mertcanaltin
Copy link
Member Author

Could it be that we are getting this error because we do not support it?

test at test/transform-decorator-namespace.test.js:65:1
✖ should transform TypeScript namespaces with additional functionality (4.865125ms)
  '  x TypeScript namespace declaration is not supported in strip-only mode\n    ,-[2:1]\n  1 |     \n  2 | ,->   namespace Validation {\n  3 | |       export interface StringValidator {\n  4 | |         isAcceptable(s: string): boolean;\n  5 | |       }\n  6 | |       const lettersRegexp = /^[A-Za-z]+$/;\n  7 | |       export class LettersOnlyValidator implements StringValidator {\n  8 | |         isAcceptable(s: string) {\n  9 | |           return lettersRegexp.test(s);\n 10 | |         }\n 11 | |         static createValidator(): LettersOnlyValidator {\n 12 | |           return new LettersOnlyValidator();\n 13 | |         }\n 14 | |       }\n 15 | `->   }\n 16 |     \n 17 |       const validator = Validation.LettersOnlyValidator.createValidator();\n 18 |       const isValid = validator.isAcceptable("test");\n    `----\n'`

@marco-ippolito
Copy link
Member

Could it be that we are getting this error because we do not support it?

test at test/transform-decorator-namespace.test.js:65:1
✖ should transform TypeScript namespaces with additional functionality (4.865125ms)
  '  x TypeScript namespace declaration is not supported in strip-only mode\n    ,-[2:1]\n  1 |     \n  2 | ,->   namespace Validation {\n  3 | |       export interface StringValidator {\n  4 | |         isAcceptable(s: string): boolean;\n  5 | |       }\n  6 | |       const lettersRegexp = /^[A-Za-z]+$/;\n  7 | |       export class LettersOnlyValidator implements StringValidator {\n  8 | |         isAcceptable(s: string) {\n  9 | |           return lettersRegexp.test(s);\n 10 | |         }\n 11 | |         static createValidator(): LettersOnlyValidator {\n 12 | |           return new LettersOnlyValidator();\n 13 | |         }\n 14 | |       }\n 15 | `->   }\n 16 |     \n 17 |       const validator = Validation.LettersOnlyValidator.createValidator();\n 18 |       const isValid = validator.isAcceptable("test");\n    `----\n'`

It says that namespaces are not supported in strip mode, you need to emable transform mode

@mertcanaltin
Copy link
Member Author

updated, thanks

@marco-ippolito
Copy link
Member

what is the difference between transform-mode.test.js and transform-feature.test.js ? why two separate files for the same thing

@mertcanaltin
Copy link
Member Author

mertcanaltin commented Aug 11, 2024

what is the difference between transform-mode.test.js and transform-feature.test.js ? why two separate files for the same thing

test/transform-mode.test.js I removed the file because it is similar as you said

@marco-ippolito
Copy link
Member

can you squash please

@mertcanaltin mertcanaltin force-pushed the dev-45 branch 2 times, most recently from 75aec79 to d1731df Compare August 12, 2024 13:35
@marco-ippolito
Copy link
Member

actually can you move all your new tests into transform.test.js. It already exists

@mertcanaltin mertcanaltin deleted the dev-45 branch August 12, 2024 15:27
@mertcanaltin
Copy link
Member Author

Moved here
#61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants