Skip to content

test: fix different test related issues - #484

Merged
asyncapi-bot merged 2 commits into
asyncapi:masterfrom
derberg:fixonestuff
Mar 26, 2023
Merged

asyncapi-bot merged 2 commits into
asyncapi:masterfrom
derberg:fixonestuff

Conversation

@derberg

@derberg derberg commented Mar 23, 2023

Copy link
Copy Markdown
Member

No description provided.

testHelper.deleteDummyContextFile();
});

describe('config:context:current', () => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this should fix random:

EPERM: operation not permitted, open 'D:\a\cli\cli\test.asyncapi'

      27 |
      28 |   createDummyContextFile(): void {
    > 29 |     writeFileSync(DEFAULT_CONTEXT_FILE_PATH, JSON.stringify(this._context), { encoding: 'utf-8' });
         |                  ^
      30 |   }
      31 |   
      32 |   deleteDummyContextFile(): void {

because as I can see, the context tests do not really need fresh context file for each test case and we can have it create just once

Comment thread src/commands/optimize.ts

if (canMove) {
const totalMove = report.moveToComponents?.filter((e) => e.action === 'move').length;
const totalMove = report.moveToComponents?.filter((e: ReportElement) => e.action === 'move').length;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

fix for

Error: src/commands/optimize.ts(135,58): error TS7006: Parameter 'e' implicitly has an 'any' type.

@derberg derberg changed the title tests: fix different test related issues test: fix different test related issues Mar 23, 2023
Comment thread package.json
"globby": "^10.0.2",
"jest": "^29.1.0",
"markdown-toc": "^1.2.0",
"react": "^16.14.0",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

generator sdk uses react 17

I just bumped into https://stackoverflow.com/questions/70079543/could-not-find-module-in-path-react-jsx-runtime-relative-to-mui-styled-engi and suggestion to use react 16.4

if I do not add react 16.4 to devDependencies then I always get the same error that @Souvikns gets and also other folks in local system:

Generator Error: Cannot find module 'react/cjs/react-jsx-runtime.production.min' from 'test/minimaltemplate/__transpiled/index.js'

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@derberg

derberg commented Mar 23, 2023

Copy link
Copy Markdown
Member Author

@Souvikns fixing 3 different errors related to testing. Please have a look and lemme know what you think.

@derberg

derberg commented Mar 26, 2023

Copy link
Copy Markdown
Member Author

/rtm

@asyncapi-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.33.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants