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

feat: jest testing #29

Merged
merged 8 commits into from
Mar 8, 2024
Merged

Conversation

gentlementlegen
Copy link
Member

Resolves #26

Copy link
Contributor

github-actions bot commented Mar 7, 2024

Coverage Report (0%) 
File% Stmts% Branch% Funcs% LinesUncovered Line #s

Copy link
Contributor

github-actions bot commented Mar 7, 2024

Unused dependencies (4)

Filename dependencies
package.json @octokit/webhooks-types
create-cloudflare
octokit
universal-github-app-jwt

Unused devDependencies (6)

Filename devDependencies
package.json @mswjs/data
@types/jest
esbuild
eslint-config-prettier
eslint-plugin-prettier
ts-node

Unlisted dependencies (10)

Filename unlisted
src/github/github-client.ts @octokit/core
@octokit/types
@octokit/plugin-paginate-rest
@octokit/plugin-rest-endpoint-methods
@octokit/plugin-retry
@octokit/plugin-throttling
@octokit/auth-app
src/github/github-event-handler.ts @octokit/auth-app
src/github/utils/config.ts yaml
tests/main.test.ts @jest/globals

Unlisted binaries (4)

Filename binaries
package.json lsof
awk
.github/workflows/build.yml build
.github/workflows/cspell.yml format:cspell

Unused exports (1)

Filename exports
src/github/types/plugin.ts convertToString

package.json Show resolved Hide resolved
@0x4007
Copy link
Member

0x4007 commented Mar 7, 2024

Looks like there's a lot of conflicts. Please handle those.

@gentlementlegen
Copy link
Member Author

Looks like there's a lot of conflicts. Please handle those.

Indeed. PR still on a draft though. We need to make a choice if we want to keep bun as the package manager? If so, I need to rewrite the tests, because at the moment its using Jest.

# Conflicts:
#	.gitignore
#	bun.lockb
#	package.json
#	src/github/types/env.ts
#	tests/__mocks__/db.ts
#	tests/main.test.ts
@gentlementlegen gentlementlegen marked this pull request as ready for review March 7, 2024 09:17
@0x4007
Copy link
Member

0x4007 commented Mar 7, 2024

What do you want to do about the failing typecheck CI? If you can't find a way to work with Bun then we can switch back to yarn 1.x

This union type stuff is really complicated to deal with @whilefoo rfc

}));

class WebhooksMocked {
// eslint-disable-next-line @typescript-eslint/naming-convention
Copy link
Member

Choose a reason for hiding this comment

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

Maybe just add this directive once at the top of the file?

@0x4007
Copy link
Member

0x4007 commented Mar 7, 2024

Unused dependencies (4)

Filename dependencies
package.json @octokit/webhooks-types
create-cloudflare
octokit
universal-github-app-jwt

Unused devDependencies (6)

Filename devDependencies
package.json @mswjs/data
@types/jest
esbuild
eslint-config-prettier
eslint-plugin-prettier
ts-node

Unlisted dependencies (10)

Filename unlisted
src/github/github-client.ts @octokit/core
@octokit/types
@octokit/plugin-paginate-rest
@octokit/plugin-rest-endpoint-methods
@octokit/plugin-retry
@octokit/plugin-throttling
@octokit/auth-app
src/github/github-event-handler.ts @octokit/auth-app
src/github/utils/config.ts yaml
tests/main.test.ts @jest/globals

Unlisted binaries (4)

Filename binaries
package.json lsof
awk
.github/workflows/build.yml build
.github/workflows/cspell.yml format:cspell

Unused exports (1)

Filename exports
src/github/types/plugin.ts convertToString

I wonder if its too noisy to add this comment on every pull. I like how it was originally implemented, with inline warnings and errors on the file view instead. @gitcoindev perhaps you can look into logging all the errors in the form of annotations on the files view?

'convertToString' is an unused export is one of those, please address that.

@gitcoindev
Copy link
Contributor

Unused dependencies (4)

Filename dependencies
package.json @octokit/webhooks-types
create-cloudflare
octokit
universal-github-app-jwt

Unused devDependencies (6)

Filename devDependencies
package.json @mswjs/data
@types/jest
esbuild
eslint-config-prettier
eslint-plugin-prettier
ts-node

Unlisted dependencies (10)

Filename unlisted
src/github/github-client.ts @octokit/core
@octokit/types
@octokit/plugin-paginate-rest
@octokit/plugin-rest-endpoint-methods
@octokit/plugin-retry
@octokit/plugin-throttling
@octokit/auth-app
src/github/github-event-handler.ts @octokit/auth-app
src/github/utils/config.ts yaml
tests/main.test.ts @jest/globals

Unlisted binaries (4)

Filename binaries
package.json lsof
awk
.github/workflows/build.yml build
.github/workflows/cspell.yml format:cspell

Unused exports (1)

Filename exports
src/github/types/plugin.ts convertToString

I wonder if its too noisy to add this comment on every pull. I like how it was originally implemented, with inline warnings and errors on the file view instead. @gitcoindev perhaps you can look into logging all the errors in the form of annotations on the files view?

'convertToString' is an unused export is one of those, please address that.

I agree. I will have a look at configuration and try to change this into annotations only.

@gentlementlegen
Copy link
Member Author

gentlementlegen commented Mar 8, 2024

What do you want to do about the failing typecheck CI? If you can't find a way to work with Bun then we can switch back to yarn 1.x

This union type stuff is really complicated to deal with @whilefoo rfc

I looked into it. The 'bun:test' is a correct module but somehow I cannot get TypeScript to understand it. I read the docs, checked everything and it should work. Execution of the code also works fine, I am very confused of the reason why it complains. I might just silence the error there.
https://bun.sh/docs/cli/test

@0x4007
Copy link
Member

0x4007 commented Mar 8, 2024

Just the convertToString thing check the files view

@gentlementlegen
Copy link
Member Author

Just the convertToString thing check the files view

I removed it but it seems Knip is still complaining about it somehow.

@0x4007
Copy link
Member

0x4007 commented Mar 8, 2024

I'm not sure I guess we can gamble and merge.

@0x4007 0x4007 merged commit c553d5a into ubiquity-os:development Mar 8, 2024
2 of 5 checks passed
@ubiquibot ubiquibot bot mentioned this pull request Mar 8, 2024
@gentlementlegen gentlementlegen deleted the feat/jest branch March 8, 2024 06:04
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.

Testing with Jest
3 participants