sazerac icon indicating copy to clipboard operation
sazerac copied to clipboard

Symbol keys

Open Thomaash opened this issue 4 years ago • 1 comments

Currently it seems that symbols are simply ignored. Is this intended behavior? Wouldn't it make more sense to check them too? I would certainly appreciate it.

MWE:

// Object.assign() assigns symbols so this test should fail but it passes.
test(Object.assign, (): void => {
  const SYMBOL_KEY = Symbol("key");
  given({}, { [SYMBOL_KEY]: true }).expect({});
});

Thomaash avatar May 22 '20 21:05 Thomaash

That seems reasonable. I haven't looked at this part of the code in a while (if ever!) and I'm not sure how the expectations are implemented. I imagine they are mostly delegated though I'm not sure.

Pull request welcome!

paulmelnikow avatar May 22 '20 21:05 paulmelnikow