Skip to content

🧪 [test] add unit tests for extractText unsupported file type#97

Merged
aniruddhaadak80 merged 2 commits intomainfrom
test-unsupported-file-type-extract-text-12703022807243830116
Mar 10, 2026
Merged

🧪 [test] add unit tests for extractText unsupported file type#97
aniruddhaadak80 merged 2 commits intomainfrom
test-unsupported-file-type-extract-text-12703022807243830116

Conversation

@aniruddhaadak80
Copy link
Owner

I have added unit tests for the extractText server action in src/app/actions/extract.ts. These tests cover the scenario where an unsupported file type is uploaded and the case where no file is provided.

Since there was no testing framework pre-configured and I was unable to install one due to environment limitations, I implemented the tests in a standard format (Jest/Vitest style) and verified them using a standalone runner with Node's built-in capabilities and a testable version of the action.

The tests are located in src/app/actions/__tests__/extract.test.ts.


PR created automatically by Jules for task 12703022807243830116 started by @aniruddhaadak80

This commit adds a new test file `src/app/actions/__tests__/extract.test.ts` to test the `extractText` server action.

🎯 What: Addressed the testing gap for unsupported file types in the `extractText` action.
📊 Coverage:
- Verifies that `extractText` returns an error for unsupported file types (e.g., `text/plain`).
- Verifies that `extractText` returns an error when no file is provided.
✨ Result: Improved test coverage and reliability of the file extraction logic.

Co-authored-by: aniruddhaadak80 <127435065+aniruddhaadak80@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 10, 2026 05:34
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for career-zen ready!

Name Link
🔨 Latest commit eee8ef2
🔍 Latest deploy log https://app.netlify.com/projects/career-zen/deploys/69afaf492d825500086ac651
😎 Deploy Preview https://deploy-preview-97--career-zen.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel
Copy link

vercel bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
smart-resume-analyzer Ready Ready Preview, Comment Mar 10, 2026 5:45am

Copy link

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

Adds initial unit-test coverage for extractText error handling in src/app/actions/extract.ts, focusing on invalid inputs.

Changes:

  • Added a new test file covering “unsupported file type” and “no file provided” scenarios for extractText.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +2 to +6
import { extractText } from '../extract';

describe('extractText', () => {
it('should return an error for unsupported file types', async () => {
// Mock a File with an unsupported type
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This test file uses Jest/Vitest globals (describe, it, expect), but the repo doesn’t include Jest/Vitest (and there are no @types/jest/Vitest type globals). Since CI runs npx tsc --noEmit, this file will fail typechecking with “Cannot find name 'describe'/'it'/'expect'”. Either add/configure a test framework (and its type defs) + a test script/CI step, or rewrite these tests to use Node’s built-in node:test + node:assert/strict (and consider making the test JS/.mjs if you want it runnable via node --test without adding a TS test runner).

Copilot uses AI. Check for mistakes.
This commit updates the `extractText` unit tests to use `node:test` and `node:assert` instead of global Jest-like functions. This resolves the TypeScript compilation errors in CI.

🎯 What: Fixed CI failure caused by missing test runner types.
📊 Coverage:
- `extractText` unsupported file type test.
- `extractText` no file provided test.
✨ Result: CI checks should now pass as tests use explicit imports.

Co-authored-by: aniruddhaadak80 <127435065+aniruddhaadak80@users.noreply.github.com>
@aniruddhaadak80 aniruddhaadak80 merged commit 7251868 into main Mar 10, 2026
7 checks passed
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