AlexLavoie42 / Nuxt-Mapbox

Elegant Mapbox integration with Nuxt
81 stars 11 forks source link

Test fail after adding this library #23

Closed steklopod closed 1 year ago

steklopod commented 1 year ago

Expected result:

all tests pass

Current result:

80 of tests fail


Tests: nuxt-vitest only

Card is showing, but tests not working

https://github.com/AlexLavoie42/Nuxt-Mapbox/assets/29500153/9fa1910d-7cb1-4812-87be-4cb590a7e15e

steklopod commented 1 year ago

I fixed it like it was suggested here by adding:

import { Blob } from 'node:buffer'
import { beforeAll } from 'vitest'

beforeAll(() => {
  globalThis.Blob = Blob // use Node.js Blob instead of Jsdom's Blob
})

Maybe it can be added to lib?