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

html reporter not working when metadata served with content type of 'application/x-gzip' #3324

Closed
6 tasks done
mzanelee opened this issue May 8, 2023 · 0 comments · Fixed by #3333
Closed
6 tasks done

Comments

@mzanelee
Copy link
Contributor

mzanelee commented May 8, 2023

Describe the bug

I'm publishing the test results provided by the html reporter in a Jenkins pipeline, I am expecting to see the test results from Jenkins but am getting a blank page with error, see screenshots

Screenshot 2023-05-08 at 12 54 22 PM

The error is caused by skipping the metadata unzip when its content-type is application/x-gzip because it's only checking for application/gzip.

I would like to submit a PR for this issue updating this line:
https://github.com/vitest-dev/vitest/blob/9836ccb48c5a39c0999484f55731f53ba494be17/packages/ui/client/composables/client/static.ts#LL77C1-L77C1

to
if (contentType.includes('application/gzip') || contentType.includes(application/x-gzip)) {

Reproduction

repo: https://github.com/mzanelee/reproduce-html-reporter-issue

steps to reproduce:

  1. run npm install
  2. run npm run test
  3. run npx http-server test-report --mimetypes '{"application/x-gzip":["gz"]}'

view error on localhost:8080

System Info

System:
    OS: macOS 13.3.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 1.23 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Chrome: 113.0.5672.63
    Safari: 16.4
  npmPackages:
    vite: ^4.3.2 => 4.3.5

Used Package Manager

npm

Validations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants