Skip to content

test: add integration tests for next js #1459

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

Merged
merged 6 commits into from
Jun 23, 2025

Conversation

grdsdev
Copy link
Contributor

@grdsdev grdsdev commented Jun 13, 2025

What kind of change does this PR introduce?

tests and ci refactor

What is the current behavior?

We currently don't test the integration between Supabase and Next.js.

What is the new behavior?

Add a new Next.js application under the tests/next folder that imports the local Supabase library and runs a simple application for making sure Supabase-js can be used in a Next.js app.

Update the CI workflow for automating the assertion that Supabase integrates with Next.js, and also separate the other kind of tests into multiple steps for better maintainability.

Additional context

Add any other context or screenshots.

@grdsdev grdsdev force-pushed the guilherme/test/next-integration branch from 6c89a96 to d965ac0 Compare June 13, 2025 17:30
@grdsdev grdsdev force-pushed the guilherme/test/next-integration branch from d965ac0 to c853ea3 Compare June 16, 2025 14:04
@coveralls
Copy link

coveralls commented Jun 16, 2025

Pull Request Test Coverage Report for Build 15826402195

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 72.889%

Totals Coverage Status
Change from base Build 15682790776: 0.0%
Covered Lines: 109
Relevant Lines: 132

💛 - Coveralls

georgRusanov and others added 3 commits June 21, 2025 11:45
* try to create a structure for the tests

* separate jobs for different tests

* ci fix

---------

Co-authored-by: georgiy.rusanov <georgiy.rusanov@ringcentral.com>
@grdsdev grdsdev requested a review from Copilot June 23, 2025 14:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds integration tests for Next.js to verify that Supabase-js works in a Next.js environment while also refactoring the test suite and CI workflow for improved maintainability.

  • Updated relative import paths in unit and type tests to reflect a new project structure.
  • Introduced a new Next.js integration test app with Playwright tests and supporting configuration files.
  • Refactored the CI workflow to separate unit, Deno, Node, and Next.js integration jobs.

Reviewed Changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 2 comments.

File Description
test/unit/.test.ts & test/types/.test-d.ts Updated relative import paths to match new project structure.
test/integration/next/**/* Added a fully configured Next.js app with integration tests and configs.
package.json Updated test scripts to include unit, integration, and type checks.
.github/workflows/ci.yml Refactored CI jobs to split test execution into distinct workflows.

npm test || npm test
npm clean-install
npm run build
npm run test:integration || npm run test:integration
Copy link
Preview

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

The use of '|| npm run test:integration' is redundant since it repeats the same command; consider removing the redundancy to improve readability.

Suggested change
npm run test:integration || npm run test:integration
npm run test:integration

Copilot uses AI. Check for mistakes.


- name: Run tests
- name: Run integration and browser tests on Deno 2.x only
if: ${{ matrix.deno == '2.x' }}
run: |
npm run test:integration || npm run test:integration
Copy link
Preview

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

The duplicate execution using the '||' operator is unnecessary here as well; removing the duplicate command can simplify the CI script.

Suggested change
npm run test:integration || npm run test:integration
npm run test:integration

Copilot uses AI. Check for mistakes.

@grdsdev grdsdev merged commit 0e55cbc into master Jun 23, 2025
6 checks passed
@grdsdev grdsdev deleted the guilherme/test/next-integration branch June 23, 2025 14:21
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.

4 participants