Skip to content
Myr

isDraftable.js

This file

Path

__tests__/isDraftable.js

7 lines · 218 bytes · JavaScript

Last changed by

chore: fix build / test issueMichel Weststratebefore adoption8aac6ca

History of this file

Take it

fix: protect isDraftable against undefined constructor (#969)Brian Hungbefore adoptionced4563

line 1why, one step back
1"use strict"

chore: fix build / test issueMichel Weststratebefore adoption8aac6ca

line 2why, one step back
2import {isDraftable} from "../src/immer"

fix: protect isDraftable against undefined constructor (#969)Brian Hungbefore adoptionced4563

lines 3–4why, one step back
3
4test("non-plain object with undefined constructor doesn't error", () => {

chore: fix build / test issueMichel Weststratebefore adoption8aac6ca

lines 5–6why, one step back
5 const obj = Object.create(Object.create(null))
6 expect(isDraftable(obj)).toBe(false)

fix: protect isDraftable against undefined constructor (#969)Brian Hungbefore adoptionced4563

line 7why, one step back
7})