Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test with jest causing an exeption #76

Closed
huci75 opened this issue Dec 21, 2022 · 1 comment
Closed

test with jest causing an exeption #76

huci75 opened this issue Dec 21, 2022 · 1 comment

Comments

@huci75
Copy link

huci75 commented Dec 21, 2022

I have to test my code with the jest framework. But every time a test is calling stringifyObject with a object its crash with follow exception:

TypeError: get_own_enumerable_property_symbols_1.default.default is not a function or its return value is not iterable

  336 |
  337 |   const obj = { status: 400, data: { code: 400, message: 'Test'} };
> 338 |   const log = stringifyObject(obj);
      |               ^

with a simply data type like string or number the test works fine. Here the example code

//util.ts
export function traceError() {
const obj = { status: 400, data: { code: 400, message: 'Test'} };
const log = stringifyObject(obj);
console.log(log);
return obj;
}

//util.test.ts
describe('functions', () => {
test('traceError should return 400', () => {
const response = traceError();
expect(response.status).toEqual(400);
});

Any solution for this?

@huci75 huci75 changed the title jest test with jest causing an exeption Dec 21, 2022
@sindresorhus
Copy link
Member

You should ask on the Jest issue tracker. This is not an issue with this package.

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants