mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-15 11:04:49 +00:00
build(deps): bump jest from 29.5.0 to 29.6.0 (#1882)
* build(deps): bump jest from 29.5.0 to 29.6.0 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.5.0 to 29.6.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.6.0/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * explorer/sagas: fix race in tests Updating from jest 29.5.0 to 29.6.0 exposed a race condition in the tests where the mock took effect too late. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Lechner <david@pybricks.com>
This commit is contained in:
co-authored by
David Lechner
parent
2be253d7fa
commit
5b5af67ba9
@@ -155,20 +155,16 @@ describe('handleExplorerArchiveAllFiles', () => {
|
||||
});
|
||||
|
||||
describe('should continue when fileStorage succeeds', () => {
|
||||
beforeEach(async () => {
|
||||
it('should catch error', async () => {
|
||||
const testError = new Error('test error');
|
||||
|
||||
jest.spyOn(browserFsAccess, 'fileSave').mockRejectedValue(testError);
|
||||
|
||||
saga.put(
|
||||
fileStorageDidDumpAllFiles([
|
||||
{ path: 'test.file', contents: 'test file contents' },
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
it('should catch error', async () => {
|
||||
const testError = new Error('test error');
|
||||
|
||||
jest.spyOn(browserFsAccess, 'fileSave').mockImplementation(() => {
|
||||
throw testError;
|
||||
});
|
||||
|
||||
await expect(saga.take()).resolves.toEqual(
|
||||
alertsShowAlert('alerts', 'unexpectedError', { error: testError }),
|
||||
@@ -182,6 +178,12 @@ describe('handleExplorerArchiveAllFiles', () => {
|
||||
it('should archive file', async () => {
|
||||
jest.spyOn(browserFsAccess, 'fileSave');
|
||||
|
||||
saga.put(
|
||||
fileStorageDidDumpAllFiles([
|
||||
{ path: 'test.file', contents: 'test file contents' },
|
||||
]),
|
||||
);
|
||||
|
||||
await expect(saga.take()).resolves.toEqual(
|
||||
explorerDidArchiveAllFiles(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user