We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
29.6.4
const axios = require('axios'); class Users { static async all(x) { try { return (await Promise.allSettled([axios.get(x)])).flatMap( (result) => result.value ); } finally { x.a.b = 'Not C'; } } } module.exports = Users;
const Users = require('../users'); const axios = require('axios'); jest.mock('axios'); describe('Users', () => { describe('.all', () => { it('Test', async () => { axios.get.mockResolvedValueOnce([]); await Users.all({ a: { b: 'c' } }); expect(axios.get.mock.calls[0][0].a.b).toEqual('c'); }); }); });
Stackblitz link: https://stackblitz.com/edit/node-fmebxovs?file=users.js Not sure how long it'll work.
Changes in finally section does not affect params. Test in the example should pass. Should show 'c'.
Changes in finally section affects params. Test fails. Shows 'Not c'.
No response
System: OS: macOS 15.3.1 CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz Binaries: Node: 20.18.1 - ~/.n/bin/node npm: 10.8.2 - ~/.n/bin/npm npmPackages: jest: ^29.7.0 => 29.7.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Version
29.6.4
Steps to reproduce
Stackblitz link: https://stackblitz.com/edit/node-fmebxovs?file=users.js
Not sure how long it'll work.
Expected behavior
Changes in finally section does not affect params. Test in the example should pass.
Should show 'c'.
Actual behavior
Changes in finally section affects params. Test fails.
Shows 'Not c'.
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: