Skip to content

Commit

Permalink
chore: bun test passing now, remove polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Oct 24, 2024
1 parent a65780f commit 402c6c9
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions examples/helia-101/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,6 @@ import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { waitForOutput } from 'test-ipfs-example/node'

/**
* @see https://bun.sh/guides/util/detect-bun
*/
if (process.versions.bun) {
// eslint-disable-next-line no-console
console.log('Running tests with bun')
/**
* Polyfill required for bun for now
*
* @see https://github.com/ipfs-examples/helia-examples/pull/101#issuecomment-2436128883
*/
globalThis.CustomEvent = globalThis.CustomEvent ?? class CustomEventPolyfill extends Event {
constructor (message, data) {
super(message, data)
// @ts-expect-error could be undefined
this.detail = data?.detail
}
}
}

const __dirname = path.dirname(fileURLToPath(import.meta.url))

await waitForOutput('Added file contents: Hello World 101', 'node', [path.resolve(__dirname, '../101-basics.js')])
Expand Down

0 comments on commit 402c6c9

Please sign in to comment.