summaryrefslogtreecommitdiffstats
path: root/test/fetch/general.js
blob: 0469875aa2deef76d3e944bf353f11f5cb55791f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict'

const { test } = require('tap')
const {
  File,
  FormData,
  Headers,
  Request,
  Response
} = require('../../index')

test('Symbol.toStringTag descriptor', (t) => {
  for (const cls of [
    File,
    FormData,
    Headers,
    Request,
    Response
  ]) {
    const desc = Object.getOwnPropertyDescriptor(cls.prototype, Symbol.toStringTag)
    t.same(desc, {
      value: cls.name,
      writable: false,
      enumerable: false,
      configurable: true
    })
  }

  t.end()
})