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

indexer: add vcr integration with vitest #82

Merged
merged 6 commits into from
Jun 20, 2024

Conversation

jaipaljadeja
Copy link
Member

@jaipaljadeja jaipaljadeja commented Jun 19, 2024

extends vitest context with vcr allowing user to use recorded streams for writing tests.

@jaipaljadeja jaipaljadeja changed the title Return outputs from replay function indexer: add vcr integration with vitest Jun 19, 2024
@jaipaljadeja jaipaljadeja marked this pull request as ready for review June 19, 2024 14:33
@jaipaljadeja jaipaljadeja requested a review from fracek June 19, 2024 14:35
Copy link
Contributor

@fracek fracek left a comment

Choose a reason for hiding this comment

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

Looks good. I think we need to add some missing extends Record<string, unknown> or I get type errors.

I will add a PR to add proper type checking before build.

@@ -29,6 +29,11 @@
"types": "./dist/sinks/csv.d.ts",
"import": "./dist/sinks/csv.mjs",
"default": "./dist/sinks/csv.mjs"
},
"./sinks/vcr": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to add the export to the "exports" section abev too.

@@ -0,0 +1 @@
export * from "./setup";
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename the folder to testing, then export it from package.json as ./testing. That way users will be able to import the functions as @apibara/indexer/testing.

@@ -0,0 +1,16 @@
import { Sink, type SinkWriteArgs } from "../sink";
Copy link
Contributor

Choose a reason for hiding this comment

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

This sink should be in the testing module since it's never used outside of testing.

Copy link
Contributor

@fracek fracek left a comment

Choose a reason for hiding this comment

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

Looks good!

@fracek fracek merged commit da2e09a into apibara:develop Jun 20, 2024
1 check passed
@jaipaljadeja jaipaljadeja deleted the feat/vcr-vitest branch December 9, 2024 13:10
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